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:
<ul> <li>http://coursesweb.net/html/</li> <li>http://coursesweb.net/css/</li> </ul>
.some_class { display: list-item; }
var obj = { "courses": ["php", "javascript", "ajax"] }; var jsonstr = JSON.stringify(obj); alert(jsonstr); // {"courses":["php","javascript","ajax"]}
$strhtml = '<body><div id="dv1">CoursesWeb.net</div></body>'; $dochtml = new DOMDocument(); $dochtml->loadHTML($strhtml); $elm = $dochtml->getElementById("dv1"); echo $elm->nodeValue; // CoursesWeb.net