HTML Basix - HTML tutorials and online webmaster tools


Htaccess code generators Code generators Tutorials

Online and offline code generators


Subscribe to RSS feed
Subscribe to the HTML Basix RSS feed.

PHP Contact Form Code Generator


Create a contact form that allows site visitors to email you without the need to use their email client. This generator will create a PHP contact form which is placed on your contact page and will display a form which site visitors fill out. When the submit button is clicked, form validation is performed using javascript. When the form submits, the visitor is presented with a 'thank you' message of your choice, and an email is sent to the stipulated address.

Code is included within the form to help prevent email header injection, preventing spammers from using your form to send mass emails.

This is a simple form, aimed at putting a basic contact form on your site. If you are proficient with HTML and PHP, you can use this form as a basis, saving you coding from scratch - and customise the form as required.

Form item instructions:
  1. Select type of field and click 'Add this item to my form'
  2. Each item must have a field name, ie: email. This doesn't get displayed, it's an 'identifier'. If not provided, a default name will be set.
  3. Enter values pertaining to the item selected
  4. When you have all of the fields you want, continue down to the email properties
    and fill in the necessary information
  5. Click generate, then copy and paste the generated code into your contact page.
If you would like to learn a bit more about PHP, have a look at the Simple PHP video tutorials. These tutorials will help you learn how to work with PHP - from installing free PHP scripts that you can download on the internet, to learning how to write PHP. They also cover tasks such as setting up a MySQL database.
Form items
Email details:
Text displayed on button:
Email address to receive the form submission:
Subject of email:
Thank-you message:

Page will open in a new window

[an error occurred while processing this directive]


Site Stats     
[an error occurred while processing this directive]
   You beaut











This site is © HTML Basix 2003 - 2009