Файл: modules/guestbook/init.php
Строк: 19
<?php
if (isset($_POST["text"]) && strlen($_POST["text"]) > 0 && strlen($_POST["name"]) > 0) {
$posted = $db->select(array("table" => "guestbook","select" => array("id","ip","date"),"where" => array("ip = ".$_SERVER["REMOTE_ADDR"]),"orderby" => array("id",DESC)));
if (strlen($posted[0]["date"]) == 10) {
$difference = time()-$posted[0]["date"];
if ($difference < 300) {
header("Location: index.php?module=guestbook&form=0&flood=1");
exit;
}
}
$new = array("ip" => $_SERVER["REMOTE_ADDR"],"name" => stripslashes($_POST["name"]),"text" => htmlspecialchars(stripslashes($_POST["text"])),"email" => $_POST["email"],"website" => $_POST["website"],"location" => stripslashes($_POST["location"]),"custom1" => stripslashes($_POST["custom1"]),"custom2" => stripslashes($_POST["custom2"]),"custom3" => stripslashes($_POST["custom3"]));
$db->insert(array("table" => "guestbook","db" => "siteman","values" => $new));
header("Location: index.php?module=guestbook&form=0");
exit;
}
?>