Introduction
In this article I show how to create a "Contact Us" form in PHP. This form is very simple and anyone can use this to help understand PHP. You can edit and add fields. You will first create a HTML file for the Contact Us form design. In the form field you will set the action for your PHP file.
Example
This is your HTML file:
- <html>
- <head>
- <title>Contact Form</title>
- </head>
- <body bgcolor="#CED2B9">
- <table width="400" border="0" align="center" cellpadding="3" cellspacing="1">
- <tr>
- <td><strong>Contact Form</strong></td>
- </tr>
- </table>
- <table width="400" border="0" align="center" cellpadding="0" cellspacing="1">
- <tr>
- <td>
- <form name="form1" method="post" action="send.php">
- <table width="100%" border="0" cellspacing="1" cellpadding="3">
- <tr>
- <td>Email</td>
- <td>:</td>
- <td>
- <input name="email" type="text" id="customer_mail" size="20">
- </td>
- </tr>
- <tr>
- <td>Name</td>
- <td>:</td>
- <td>
- <input name="name" type="text" id="name" size="20">
- </td>
- </tr>
- <tr>
- <td width="16%">Subject</td>
- <td width="2%">:</td>
- <td width="82%">
- <input name="sub" type="text" id="subject" size="24">
- </td>
- </tr>
- <tr>
- <td>Detail</td>
- <td>:</td>
- <td>
- <textarea name="msg" cols="20" rows="4" id="detail"></textarea>
- </td>
- </tr>
- <tr>
- <td> </td>
- <td> </td>
- <td>
- <input type="submit" name="Submit" value="Submit">
- <input type="reset" name="Submit2" value="Reset">
- </td>
- </tr>
- </table>
- </form>
- </td>
- </tr>
- </table>
- </body>
- </html>



Pardeep KumarPosted Jun 14, 2018, 3:03 AM
Nice ! but its very simple you don't use any validation option or if i like to send any attachment so how can i send ?
shrawan kickPosted Oct 16, 2017, 2:36 AM
Hi do you have code in git please add the link