Here’s How To Create A Contact Form Without Plugins In WordPress

Here's How To Create A Contact Form Without Plugins In WordPress

The existence of a contact page on a web or blog can be said to be important. This aims to facilitate the private relationship between visitors and web admins or blogs. And to meet these needs, for CMS WordPress blogs except just triggering a contact form is easy to do.

Good that (free) or (TLD). But for has advantages in terms of freedom of expression to pamper its users. For example, in the case of triggering a contact form not only able to use plugins, we are also able to trigger a contact form in WordPress without using plugins. The requirement we need a little understanding of php and css code. For these purposes, here I will share the steps to trigger a contact form without a plugin on a WordPress CMS blog.

In a previous post, I discussed about creating a contact form in WordPress. But for the next article I gave an example by using a plugin, namely the contact form7 plugin. Please be able to see your own writing unless it is necessary to this article How to create a contact Form in WordPress.
For the contact form that I will discuss here is a contact form without plugins. I think it looks no less interesting than the one using the plugin. Instead we will be more free expression in the application of stylenya. And also, our blog page loading will be light, compared to the contact form plugin results.

Here’s how to create a contact Form without plugins on a WordPress CMS Blog

Here's How To Create A Contact Form Without Plugins In WordPress
Here’s How To Create A Contact Form Without Plugins In WordPress

If you are interested in trying to practice it, let’s just do the tutorial. All we need to trigger a contact form without a plugin is, a Notepad application.

I think for the Notepad application we will not find any difficulties. Because this application is a default program (default) Windows. Please without further ado, open the Notepad application that is already installed on the Windows computer via Start > All Programs > Accessories > Notepad.

1 # Create A Template Name
First we create the name of the template that we will create by inserting the next php code in Notepad :

The example here I give the name of the template that we will create is a contact Form. You can specify a different template name, or it’s fine.

2 # Make An Error Command
The purpose of the error command here is a benefit to adjust the error notification / error available unless they carry out submit and each form is available that does not match what we have specified. Examples in the contact form that will be created here, we only provide 3 forms to be filled, form name, form email, and form content email/message. Then from the next three forms, none of us trigger the optional form, meaning that all forms need to be filled out mandatory. Then when the sender forgets to fill in one of the forms, the message content will not be sent successfully and an error command will appear indicating which form is wrong. Well at this time we will trigger the error command. And here we only trigger 3 forms that need to be filled in, name form, email form, and message body form. The code for the benefit of the error command is like this :
Download Code

3 # Specify The Email Address Of The Recipient Of The Message Content
If later available that send a message through the contact form page that we provide on the blog or website, then the contents of the next message we need to point to a special place. Not available anywhere else reset not only we specify it to the e-mail address that we have. The contents of the message in the contact form of this web page will be successfully sent and we can read the contents unless the sending has carried out the filling of the form correctly. Insert the next code to specify the e-mail address that functions as the recipient of the contents of the message sent comes from the contact form of the blog page :

Download Code

Readjust the recipient’s e-mail address to the e-mail address you have. Then you can also influence the subject and header content of the e-mail to what you want.

4 # Create A Contact Form
If the Three steps above have been created or inserted in Notepad, now is the time to trigger the core activity, which is triggering the contact form. As I explained above, the contact form that we will create only consists of a name form, an email form, a message content form, and a submit button. Then I will provide a check button whose function is to trigger a copy of the message to the sender’s e-mail address unless the sender checks it. The example code to trigger the contact form I’m referring to is as follows :

Download Code

You can specify your own for each size weight and height form.

5 # Make The Contents Of The Report Success/Failure When The Message Is Sent
In triggering the contact form, it should be added calculated with the report. Whether the contrived message was sent successfully or otherwise failed. This is to give confidence to the sender of the message and so that there is no double publish. An example code to trigger a report that a message has been successfully sent is as follows :

Leave a Reply

Your email address will not be published. Required fields are marked *