<?php
function get_microtime(){
$explode = explode(' ', microtime());
return ($explode[0] + $explode[1]);
}
$start = get_microtime();
$file10 = fopen("bannati.php", "r");
$dimensione10 = filesize("bannati.php");
$contenuto10 = fread($file10, $dimensione10);
$ex = explode(" ", $contenuto10);
for ($x=0; $x<=count($ex); $x++) {
if ($ex[$x] == $_SERVER['REMOTE_ADDR']) {
header("location: admin/bannato.php");
} else {
}
}
include("config.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="skin/<?php echo $skin; ?>" type="text/css" rel="stylesheet">
<title><?php echo "$guestbook - Scrivi un messaggio"; ?></title>
<script language="JavaScript" type="text/JavaScript">
function smiley(code)
{
var testo = document.form.testo.value;
this.code = code;
document.form.testo.value = testo + code;
}
</script>
</head>
<body>
<?php
$smiley = "smiley/smiley.txt";
$apri = fopen($smiley, 'r+');
$grandezza = filesize($smiley);
$leggi = fread($apri, $grandezza);
$capo = chr(13);
$controllo = explode(" - ", $leggi);
$parole = "smiley/parole.txt";
$apria = fopen($parole, 'r+');
$grandezzaa = filesize($parole);
$leggia = fread($apria, $grandezzaa);
$controlloa = explode(" - ", $leggia);
if (!$_POST['testo']) {
?>
<form method="post" action="scrivi.php" name="form" onSubmit="this.ok.disabled=true;">
<div align="center"><font class="title"><?php echo "$guestbook"; ?></font><br>
<br>Lascia un <font color="#FF0000">messaggio</font> nel guestbook del CFL site...Ogni commento, consiglio, critica o semplice saluto è gradito!!!
Cerca di evitare messaggi pubblicitari o di spam, anche perchè verranno subito cancellati!!
<font color="#0000FF">Grazie</font> per la tua gentile partecipazione!!<br>
<br>
<table width="400" border="0" align="center">
<tr class="main">
<td width="50%" align="center"><font class="scritte"><b>Nome</b></font></td>
<td width="50%" align="center"><font class="scritte"><b>Mail</b></font></td>
</tr>
<tr>
<td height="20" align="center"><input type="text" name="autore" maxlength="20"></td>
<td height="20" align="center"><input type="text" name="mail"></td>
</tr>
</table>
<table width="400" border="0" align="center">
<tr class="main">
<td width="50%" align="center"><font class="scritte"><strong>Sito web </strong></font></td>
<td width="50%" align="center"><font class="scritte"><strong>Provenienza</strong></font></td>
</tr>
<tr>
<td height="20" align="center">
<input type="text" name="sitoweb0" value="http://"></td>
<td height="20" align="center">
<input type="text" name="provenienza0" maxlength="17"></td>
</tr>
</table>
<table width="400" border="0" align="center">
<tr class="main">
<td width="100%" align="center" colspan="2"><font class="scritte"><b>Messaggio</b></font></td>
</tr>
<tr>
<td height="20" align="center" colspan="2"><textarea name="testo" cols="65" rows="6" onKeyDown="if(this.value.length><?php echo $massimo; ?>)this.value=this.value.substr(0,<?php echo $massimo; ?>)"></textarea></td>
</tr>
<tr>
<td align="center" colspan="2"><?php
foreach($controllo as $limi) {
$ciao = explode(" ", $limi);
if ($ciao[0] == "") {
} else {
$faccina = "<img src=\"smiley/$ciao[0].gif\" alt=\"\" title=\"$ciao[1]\" style=\"cursor:pointer\" onClick=\"smiley(' $ciao[1] ')\">";
echo "$faccina";
}
}
$end = get_microtime();
$tempo = $end-$start;
$tempo = substr($tempo, 0, 5);
?>
</td>
</tr>
<tr>
<td width="60%" align="center"><strong>Inserisci il codice di controllo: <img src="http://www.cflgroup2001.it/tabelle/contr.gif" alt="contr" />
</strong> </td>
<td width="39%" align="center"><input type="text" name="code" /></td>
</tr>
<tr class="main">
<td width="100%" align="center" colspan="2"><font class="scritte"><b>Conferma</b></font></td>
</tr>
<tr>
<td align="center" colspan="2"><input type="submit" name="ok" value="Scrivi messaggio" onCLick="invia()"></td>
</tr>
</table>
<br>
<div align="center"><br><a href="index.php" class="scrivi">Torna al guestbook</a><br><br><font color="#CCCCCC"><a href="admin/index.php">Admin</a> powered by txtguestbook. Copyright <a href="http://www.jamsofts.net">jamsofts</a><br>Pagina caricata in <?php echo $tempo; ?> secondi</font></div>
</div>
</form>
<?php
} else {
$autore = $_POST['autore'];
$testo = $_POST['testo'];
$sitoweb = $_POST['sitoweb'];
$provenienza = $_POST['provenienza'];
$ora = (date("G:i"));
$data = (date("d-m-y"));
$mail = $_POST[mail];
$ip = $_SERVER['REMOTE_ADDR'];
if (trim($autore) == "" OR trim($testo) == "") {
header("location: scrivi.php");
} else {
$nl = chr(13);
$testo = eregi_replace("$nl",";:;br:;:", $testo);
foreach($controllo as $limi) {
$ciao = explode(" ", $limi);
$testo = str_replace($ciao[1], ";:;img src=smiley/$ciao[0].gif alt=:;:", $testo);
}
foreach($controlloa as $limia) {
$ciaoa = explode(" ", $limia);
$testo = str_replace($ciaoa[0], $ciaoa[1], $testo);
$testo = str_replace("<", "<", $testo);
$testo = str_replace(">", ">", $testo);
$testo = str_replace(",", "%&", $testo);
}
$autore = str_replace("<", "<", $autore);
$autore = str_replace(">", ">", $autore);
$autore = str_replace(",", "%&", $autore);
$sitoweb = str_replace("<", "<", $sitoweb);
$sitoweb = str_replace(">", ">", $sitoweb);
$sitoweb = str_replace(",", "%&", $sitoweb);
$mail = str_replace("<", "<", $mail);
$mail = str_replace(">", ">", $mail);
$mail = str_replace(",", "%&", $mail);
$provenienza = str_replace("<", "<", $provenienza);
$provenienza = str_replace(">", ">", $provenienza);
$provenienza = str_replace(",", "%&", $provenienza);
$testo = str_replace("\n", "", $testo);
$file = "mess.php";
if ($notifiche == "Si") {
mail($admin_mail, "Nuovo messaggio nel guestbook", "Ciao $admin_user, $autore ha appena scritto un messaggio nel tuo guestbook. www.cflgroup2001.it/guest.htm", "From: Txtguestbook");
} else {
}
$apertura = fopen($file, 'r+');
$dimensione = filesize($file);
$contenuto = @fread($apertura, $dimensione);
$chiusura = fclose($apertura);
if ($approva == "Si") {
$validato = "0";
} else {
$validato = "1";
}
if ($ultimo == "0") {
$nuovo = "$autore, $testo, $data, $ora, $mail, $sitoweb, $provenienza, $ip, $validato((!|!))$contenuto";
} else {
$nuovo = "$contenuto((!|!))$autore, $testo, $data, $ora, $mail, $sitoweb, $provenienza, $ip, $validato";
}
$add = fopen($file, 'w+');
$scrivi = fwrite($add, $nuovo);
$chiudi = fclose($add);
?>
<div align="center"><font class="title"><?php echo "$guestbook"; ?></font><br>
<br>Grazie per aver lasciato un messaggio. <?php
if ($approva == "Si") {
echo "Appena il messaggio sarà controllato e validato dall'amministratore del guestbook comparirà in home!!";
}
?><br> </div>
<div align="center"><a href="index.php" class="scrivi">Torna al guestbook</a></div>
<?php
}
}
?>
</body>
</html>