Witam serdecznie. Mam na stronie poniższy kod. Czy ktoś mógłby mi podpowiedzieć jak zabezpieczyć ankietę przed wielkorotnym wypełnianiem za pomocą cookies lub za pomocą ip?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-2" />
<link rel="stylesheet" type="text/css" href="style.css" />
<?php
if (count($_POST))
{
////////// USTAWIENIA //////////
$email = 'xxx@onet.pl'; // Adres e-mail adresata
$subject = 'Pytanie1'; // Temat listu
$message = 'Twoje odpowiedzi zostały przesłane!'; // Komunikat
$error = 'Wystąpił błąd! Spróbuj jeszcze raz!'; // Komunikat błędu
$charset = 'iso-8859-2'; // Strona kodowa
//////////////////////////////
$head =
"MIME-Version: 1.0\r\n" .
"Content-Type: text/plain; charset=$charset\r\n" .
"Content-Transfer-Encoding: 8bit";
$body = '';
foreach ($_POST as $name => $value)
{
if (is_array($value))
{
for ($i = 0; $i < count($value); $i++)
{
$body .= "$name=" . (get_magic_quotes_gpc() ? stripslashes($value[$i]) : $value[$i]) . "\r\n";
}
}
else $body .= "$name=" . (get_magic_quotes_gpc() ? stripslashes($value) : $value) . "\r\n";
}
echo mail($email, "=?$charset?B?" . base64_encode($subject) . "?=", $body, $head) ? $message : $error;
}
else
{
?>
<form action="?" method="post"> <input name="Imię" />Podaj swój nick
<br />
<!-- Pole typu RADIO -->
<input type="radio" name="pytanieA" value="0" />0
<input type="radio" name="pytanieA" value="1" />1
<!-- Pole typu RADIO -->
<input type="radio" name="pytanieB" value="0" />0
<input type="radio" name="pytanieB" value="1" />1
<!-- Przycisk WYŚLIJ -->
<input type="submit" value="Wyślij wynik" />
<?php
}
?>
<!-- End Right Column -->
<!-- End Wrapper -->