With the script presented in this page (created with PHP and AJAX) you can add a Contact Form in your website, through which the visitors can send messages to the administrator e-mail address directly from site.
The received email contains: the Name and IP of the sender, his /her E-mail address, the Subject, and Message added in textarea in the form.
The Contact Form can be added in both "*.html" or "*.php" files, but the web server must run PHP.
- The form is valid XHTML and has antispam verification code. The Ajax technology avoids resending data in case of refresh.
The script also works if the user has disabled JavaScript. As anti-spam and re-sending data additional protection, the PHP script blocks the user to send another email in the next 5 minutes.
Form fields are checked and validated with JavaScript.

You can download the script from this link -> Contact Form.

The contact form is like this:

Send a message

Verification code:
Add the verification code:

- The script has included the PHPMailer class, so you can choose to send the email with the PHP mail() function, or via a GMail account.
Details about how to install and use this Contact Form script are in "Read.html" file (in the archive you can Download from the link above).
- For those interested to learn PHP and Ajax, there are helpful explanations in comments in code.

This script is free (does not provide support or personal modifications).

It was successfully tested with a general configuration on localhost with XAMPP. If on other systems does not work properly, depends on their configuration.

Daily Test with Code Example

Which tag adds an image in web page?
<div> <img> <span>
<img src="http://coursesweb.net/imgs/webcourses.gif" width="191" height="63" alt="Courses-Web" />
Which of these CSS codes displays the text oblique?
font-style: italic; text-decoration: underline; font-weight: 500;
#id {
  font-style: italic;
Click on the jQuery function used to hide with animation a HTML element.
click() hide() show()
$(document).ready(function() {
  $(".a_class").click(function(){ $(this).hide("slow"); });
Click on the correctly defined function in PHP.
fname function() {} function fname() {} function $fname() {};
function fname($a, $b) {
  echo $a * $b;
Contact Form, PHP - AJAX

Last accessed pages

  1. HTML5 Quick Tutorial (1031)
  2. Add and Remove HTML elements and Content with jQuery (6805)
  3. CSS Trapezoid Shape (1262)
  4. JavaScript Trivia Game (1199)
  5. Get and Modify content of an Iframe (2239)

Top accessed pages

  1. PHP-MySQL free course, online tutorials PHP MySQL code (11244)
  2. Courses Web: PHP-MySQL JavaScript Ajax HTML CSS Flash-AS3 (10870)
  3. Get Attribute (ID, Class, Name, Title, Src) with jQuery (10498)
  4. PHP Chat Script (9631)
  5. PHP PDO - exec (INSERT, UPDATE, DELETE) MySQL (9325)