<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="ro"> <head> <title>Script Contact Form</title> </head> <body> <center><h2>Script Contact Form</h2> <sup>from <a href="http://www.coursesweb.net/php-mysql/">www.coursesweb.net</a></sup></center><br /> With this script (that uses PHP and AJAX) you can add a simple <b>Contact Form</b> in your website, through which the visitors can send messages to the administrator e-mail address directly from site.<br/> The <em>Contact Form</em> can be added in both "*.html" or "*.php" files, but the web server must run PHP.<br/> - The form is valid XHTML and has antispam verification code. The Ajax technology avoids resending data in case of refresh.<br/> The script also works if the user has disabled JavaScript. As anti-spamm and re-sending data additional protection, the PHP script blocks the user to send another email in the next 5 minutes.<br/> The script sends the message with the PHP mail() function, but if the server on which your website is hosted doesn't have a mail server, you can easily set to send the message via a GMail account; in this case you must have a GMail account, it's free and can be created at the page: <a href="https://www.google.com/accounts/ServiceLogin?service=mail&passive=true&rm=false&continue=https%3A%2F%2Fmail.google.com%2Fmail%2F%3Fhl%3Dro%26tab%3Dwm%26ui%3Dhtml%26zy%3Dl&bsv=llya694le36z&scc=1<mpl=default<mplcache=2&hl=en&from=login">GMail</a>. <h4>Installation:</h4> 1. Open the "contact_mail.php" file and change the value of the <b>$to</b> variable: <pre> $to = 'hide@address.com'; - Replace the <i>'hide@address.com'</i> with the e-mail address to which you want the message to be sent. </pre> <i>- If you want to use the SMTP from GMail, set the value 1 at <b>$gmail</b> variable (line 12 in the "contact_mail.php" file).<br /> - Add your GMail address at the <b>$gmail_user</b> variable, and add the password for this e-mail at <b>$gmail_pass</b>.<br /> - When using Gmail, the messages will be sent to the e-mail address added in the "$to" variable, but via your GMail account.</i><br /><br /> 2. Copy the "<b>contact_mail.php</b>", "<b>contact.js</b>", and the "<b>gmail</b>" folder with all its files on your server (in the same place where you have the file in which you want to include the contact form):.<br /> 3. Add the following HTML code in the "*.html", or "*.php" file in which you want to display the contact form (<i>as you can see added in the "<b>test.html</b>" file</i>): <pre style="color:blue; font-weight:bold;"> <form style="width:350px; background:#e8e8fe; text-align:center;" id="cform" method="post" action="contact_mail.php"> <h3 id="fc_titlu"><u>Send a message</u></h3> <label for="nume">Your Name: &nbsp;</label><input type="text" name="nume" id="nume" size="18" maxlength="40" /><br /> <label for="email">Your E-mail:</label> <input type="text" name="email" id="email" size="18" maxlength="58" /><br /> <label for="subject">Subject: &nbsp; </label> <input type="text" name="subject" id="subject" size="28" maxlength="70" /><br /> <label for="message">Your message: (<i>maximum 500 characters</i>)</label><br /> <textarea name="message" id="message" cols="35" rows="6"></textarea> <input type="hidden" name="anti_spam" id="anti_spam" value="" /><br /> <a href="http://www.coursesweb.net/" title="Free WebMaster Courses" target="_blank" style="font-size:8px; color:#eaeafe;">www.coursesweb.net</a><br /> <i>Verification code:</i> <b id="codas"> </b><br /> Add the verification code: <input type="text" name="anti_spam1" id="anti_spam1" value="" size="7" maxlength="7" /><br /> <input type="submit" value="Send" id="csubmit" /> </form> <script type="text/javascript" src="contact.js"></script> </pre><br /> <i>- <b>This script is free, you can change and use it as you want, but <u>does not provide support or personal modifications</u>.</b><br/><br/> It was successfully tested with a general configuration on localhost with XAMPP</i>. If on other systems does not work properly, depends on their configuration.</i><br /><br /> Respectfully,<br /> Marius </body> </html>