Features: 1. The script checks that all form fields are filled and that e-mail address has the correct form. 2. To prevent spam, a user is required to enter a security code (turing number). 3. HTML code validates as HTML 4.0 or XHTML 1.0. 4. Currently, two stylesheets are included: style-simple.css and style-graphic.css. Testing the script: 1. Open one of the sample forms (sample-???-???.php) in any text editor. 2. Find the line $contact_form_your_email = "your_account@your_email.com"; and replace the text "your_account@your_email.com" with your e-mail address. 3. Upload all files to your server. 4. Open the selected sample form in your browser. Installation: 1. The script uses PHP sessions. To start a session, add the following code in the beginning of your contact page: Note 1: The line above should be placed before any HTML output and even before any whitespaces. Note 2: PHP occasionally adds query string containing session id to URL. If you want to avoid this, use the following code instead of the one above. 2. To use one of the included stylesheets, add the following code between
and tags: or If necessary, correct the URL in the href="..." attribute. 3. Add the following code to your contact page: Set $contact_form_xhtml to true if you use XHTML syntax and to false if you use HTML syntax. Set $contact_form_graphic_button to true if you use graphic submit button and to false if you use standard submit button. $contact_form_image_url should contain the URL of the image.php script. $contact_form_your_name and $contact_form_your_email should contain your name and e-mail. $contact_form_message_prefix can be used to prefix all messages, so that you can know that the message was sent from your contact form and not from somewhere else. If necessary, correct the path to the contact-form.php script. 4. There are more configuration variables in the beginning of the contact-form.php file. If you have any difficulties installing the script, feel free to contact me. If you find this script useful, consider placing the link to the homepage of this script http://www.php-development.ru/php-scripts/contact-form.php somewhere on your site. Ilya S. Lyubinskiy http://www.php-development.ru/