venerdì 15 novembre 2013

Form script

A very useful script for a "contact us" forms with 2 alerts
Un utilissimo script con 2 alerts per un modulo "contatti"

The form page is here: www.ruggia.net/english/contatti.htm [HTML5]
La pagina del modulo è qui: www.ruggia.net/contatti.htm [HTML5]

The script:

<?php session_start(); ?>
<?php
// - First, we need to set few Variables to handle all the dirty work!
$SiteName = "Dal sito";
$SiteEmail = "nuccio@ruggia.net";
// - That's it! That's All You Need To Do!!
$AdminMessage .= "Nome: $Nome\n";
$AdminMessage .= "Cognome: $Cognome\n";
$AdminMessage .= "E-mail: $Mail\n";
$AdminMessage .= "$info\n";
// Beginning of Securimage code
include_once $_SERVER['DOCUMENT_ROOT'] . 'D:\inetpub\webs\ruggianet/securimage/securimage.php';
$securimage = new Securimage();
if ($securimage->check($_POST['captcha_code']) == false) {
// error control
echo "<script language='javascript'>alert('Incorrect code, retry!');</script>";
echo "<script>window.history.back()</script>";
exit;
}
// End of Securimage code
mail("$SiteEmail", "Writing from your site", $AdminMessage, "From: $Name $LastName");
?>
<script type="text/javascript">
window.alert("Message sent, thank you!")
</script>
<script language="javascript"
type="text/javascript">document.location.href="contatti.htm";</script>

More details see here: http://www.phpcaptcha.org/

Mine is higly customized by me of course...


NR Design

Nessun commento:

Posta un commento