Inserita pagina di errore nei 2 form:
Forms error pages created:
www.ruggia.net/contatti_error.htm
www.ruggia.net/servizi_error.htm
www.ruggia.net/english/servizi_error.htm
www.ruggia.net/english/contatti_error
www.ruggia.net/servizi.htm
www.ruggia.net/english/servizi.htm
CSS to add
div.note {
text-align: left;
padding: 10px 10px 10px 48px;
border: 4px solid;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
-khtml-border-radius: 8px;
margin: 5px 0px;
line-height: 1350%;
}
div.alert {
background: #9b0000 url(../img/alert.png) no-repeat 10px 50%;
border-color: #FF0000;
color: #FFFFFF;
}
div.white a:link { font-size:16px;font-family:Trebuchet MS, Arial;color:#FFFFFF;}
-----------------------------------------------------------------------------------
sendmail.php (contact page)
<?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: $requiredNome\n";
$AdminMessage .= "Cognome: $requiredCognome\n";
$AdminMessage .= "E-mail: $requiredMail\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) {
// the code was incorrect
// you should handle the error so that the form processor doesn't continue
// or you can use the following code if there is no validation or you do not know how
// echo "The security code entered was incorrect.<br /><br />";
// echo "Please go <a href='javascript:history.go(-1)'>back</a> and try again.";
// exit;
header("Location: http://www.ruggia.net/contatti_error.htm#error");
exit;
}
// End of Securimage code
mail("$SiteEmail", "$SiteName ti scrivo", $AdminMessage, "From: $requiredNome $requiredCognome");
?>
<script type="text/javascript">
window.alert("Messaggio inviato correttamente!")
</script>
<script language="javascript"
type="text/javascript">document.location.href="contatti.htm";</script>
<!-- - vecchio refresh: header("Location: http://www.ruggia.net/contatti.htm"); -->
---------------------------------------------------------------------------------
HTML Capcha code
<!-- Begin captcha code -->
<a NAME="error"></a>
<img id="captcha" src="/securimage/securimage_show.php" alt="CAPTCHA Image" /><br>Insert code*<br><div class="note alert white">Invalid code, go back and retype the new code.
<a href="javascript:history.go(-1)">[Go Back]</a></div>
<input type="text" name="captcha_code" size="10" maxlength="6" />
<a href="#" onclick="document.getElementById('captcha').src = '/securimage/securimage_show.php?' + Math.random(); return false">[ new code ]</a><br><br>
<!-- End of captcha code -->
Nuccio Ruggia