How to Make a PHP Contact Form

Getting Started with the Basics of How a Contact Form is Built and Processed with PHP

To make a basic contact form with php, we first need to have a standard html form to collect the information from the user. For this example we will create a form with a text field for people to enter their email address for use in a mailing list.

<form action=”yourfile.php” method=”post”>
<input name=”emailaddress” type=”text” size=”40″>
<input type=”submit” name=”Submit” value=”Submit”>
</form>

Which would produce this …

Note the forms action to post to the file “process.php”. Also note the text field name, as we will be using this to convert to php. So now we need to move on and create that file to process the form and send it to your email.

Next

Enjoy this blog? Please spread the word :)