$txt_fill $txt_req_fields"); } // controllo che la lunghezza dei campi nick sito email non siano maggiori di tot caratteri if ( strlen ( $nick) > 30 or strlen ( $sito ) > 50 or strlen ( $email) > 50 ) { die( "$txt_entry_maxsize"); } if ( strlen ( $msg) > 400 ) { die( "$txt_entry_toolong"); } //controllo url if(!eregi("^http\:\/\/",$sito)) { echo "$txt_entry_url"; exit; } //coontrollo mail chiocciola ecc.. if ($email!="") { if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) { die( "$txt_invalid_mail"); } } //faccine if ($con_smile==1){ $msg = str_replace(':-)', ':-)', $msg); $msg = str_replace(':-(', ':-(', $msg); $msg = str_replace('P-)', 'P-)', $msg); $msg = str_replace('S-)', 'S-)', $msg); $msg = str_replace('L-)', 'L-)', $msg); $msg = str_replace(':-P', ':-P', $msg); $msg = str_replace('M-)', 'M-)', $msg); $msg = str_replace('Z-)', 'Z-)', $msg); $msg = str_replace('G-)', 'G-)', $msg); $msg = str_replace(':-M', ':-M', $msg); } //campi nascosti data e ip $ip = $_POST['ip']; $data = date('j/n/y - H:i') ; //nome del file dei dati $dati_file = "dati/dati.txt"; //creo la riga di messaggio nel file di testocon di dati e il separatore | $riga_messaggio = "$nick|$sito|$email|$msg|$data|$ip"; $riga_messaggio = str_replace("\n","
",$riga_messaggio); $riga_messaggio = stripslashes($riga_messaggio); $riga_messaggio .= "\n"; $fp = fopen($dati_file, "a"); //apro il file di testo if(!$fp) { echo "$txt_cant_open"; exit; } $fw = fwrite($fp, $riga_messaggio); //scrivo la riga del messaggio nel file di testo $fc = fclose($fp); //chiudo il file di testo echo "$txt_entry_ok
$txt_view_entry
"; //manda mail if ($sendmail== 1){ $headers = "From: $txt_guestbook\r\n"; $soggetto = "$txt_new_entry"; //oggetto della mail $msg_mail = Strip_Tags($_POST['msg']); $messaggio = "$txt_new_entry $txt_by $nick, $txt_message :\n $msg_mail \n $txt_on $txt_date : $data \n $txt_from_ip : $ip"; mail($tuaemail, $soggetto, $messaggio,$headers); } } ?>

readwrite

e-mail
*
*
*
© 2005 PaoBacheca power by Zenas.org"; ?>