TechArena Community

TechArena Community (http://forums.techarena.in/)
-   Tips & Tweaks (http://forums.techarena.in/tips-tweaks/)
-   -   Tips to create a simple HTML Contact US From (http://forums.techarena.in/tips-tweaks/1474971.htm)

Nathen 24-07-2014 04:39 PM

Tips to create a simple HTML Contact US From
 
Contact Us forms is an important part of your site. It allows the users to communicate with you when needed. In WordPress or in other CMS you have a ready to use plugin. You just have to add that and configure the settings. But when it comes to a plan html or php site, you have to use coding. You can try using a simple html code to create a html contact us form. Here I am going to give you some simple and easy to use steps through which you can make a nice contact us form in faster way. All you have to do is checkout the coding properly. To make a form you need two things. First the contact us page which will be in html and then a php script which will process the form and it will send the data on your email. In HTML is hard to embeds any plugin if you are not having coding knowledge. So things are manual here. Through the below process you can also find out why your contact us form is not working. The process is not so complicated to use. You have to understand a bit of html elements and then you can make your own form. You can simply download ready to use scripts and upload them on your web server. That would be also a lot more easier option for you to deal with. Going with ready to use script is easier way because you have to just add your mail and upload the file on the web server. That's it. You can find that by searching on Google. Below I am going to give you the manual way.

Process:

Creating a Contact US html apge. You can create this from any existing page of your site. For example you can use the about us page or home page. All you have to do is delete the content between <body> </body> and what code I am going to offer you. Just check once if you are not having any extra elements like a side box or any thing. Because that will also be removed. A sample code is provided below. We have to create a table to make a form. The first line in the below code you can see has required details. We are using the post method and the action is assigned to second file which is conatctus.php. When the user hits the send or submit button the contactus.php file will process the data.

HTML Code:

[size="3"]<form name="nameofform" method="post" action="contactus.php">
<table width="400px">
</tr>
<tr>
<td valign="top"><label for="first">First Name</label></td>
<td valign="top"><input  type="text" name="firstname" maxlength="40" size="22"></td>
</tr>[/size]

The above is the first part of code. We will define the width of table. You can adjust the width as per your need and the form will fit well on your page. Then comes the alignment and label for text. You have to copy the same code above and create box for Last Name, Email, Mobile Number, etc.

HTML Code:

[size="3"]<tr><td valign="top"> <label for="message">Messsage *</label></td>
<td valign="top"> <textarea  name="message" maxlength="300" cols="19" rows="9"></textarea></td>[/size]

Then comes the message box. You can increase the characters under maximum length. The code is above for that. And the last is to create a simple submit button.

HTML Code:

[size="3"]</tr><tr> <td colspan="2" style="text-align:center">  <input type="submit" value="Submit">( <a href="http//yourdomain.com/contactus.php">From</a> ) </td> </tr>[/size]
Above you can see a sample code for submit buton. You can also add a iamge. for the same. You have to craet the code and add this beweent

<form><table>html contact us form code </table></form> this. This will be placed below body. Your form has done. The next thing is creating the php script to process the form. There are ample of site on the web that wil provide you a ready to use php script. You have to check two things in that. First go under $email_to = "youremailid" and add a subject under $email_subject = "subjectline;. That's it. Your form is done. You can play with css in making the form more good in terms of look.

Vandam 28-07-2014 10:59 AM

Re: Tips to create a simple HTML Contact US From
 
There are few sites which can provide you option for creating a form on your self. You can try them also. I had used one of them. This site gives you sample form design. You can download and add them on your page and it will start working as per your need. You dont really need to go with coding. This type of coding tips is good for those who are either learning or who wants to create their own HTML form manually. Other wise there are ample of free script available for download.


All times are GMT +5.5. The time now is 10:42 PM.