So che rompo...
La questione di Bannare gli utenti che insultano o fanno <A HREF="http://zeusnews.it/zn/17112" target="_blank">SPAM</A> è risolta.
Anzi grazie mille a voi tutti
Ora, invece, il problema è il sistema antifrode.
Ora lo script prevede il controllo attraverso i cookies ma, basta cancellarli e si può votare quante volte si vuole alla faccia del mio settaggio che è di un'ora.Non sono riuscito a trovare alcuna soluzione valida, l'unica che mi viene in mente è quella di non tenere conto dei cookie ma di confrontare l'IP del votante con l'ora della sua ultima votazione. Se questa è < 3600 secondi allora il voto non viene assegnato.
IP e Orario di votazione sono segnati in una tabella così:
sid ip cdate
1138553951 81.208.36.93 2006-07-13 21:08:14
1138553951 81.208.36.93 2006-07-13 22:37:35
1138553951 81.208.36.93 2006-07-17 11:06:57
1138553951 85.18.136.71 2006-07-14 05:12:46
dove sid è l'ID del Sito votato, IP è quello del sito che ha votato e cdate è l'orario in cui ha votato.
Come detto prima, questi dati sono scritti in un cookie. Cancellato il cookie, si vota tranquillamente.
Riporto qui sotto il codice della pagina in cui vengono fatti i controlli e vengono mandati i messaggi.
$err = 1 la votazione è effettuata correttamente;
$err = 2 il voto non viene assegnato (ma basta cancellare i cookie e questo messagio non compare mai):
$err = 5 ti invita ad abilitare i cookie (è addirittura comico, basta che i cookie li cancello prima di arrivare alla pagina di cui vi fornisco il codice).
Sono andato su Hotscript per vedere se esiste una versione più "furba"...nulla da fare. Vi sarei eternamente grato se mi aiutaste a risolvere il problema.
Ecco la pagina in.php:
Codice: Seleziona tutto
<?
include "config.php";
if (!$site) header("location: $url_to_folder");
$get_rows = mysql_db_query ($dbname,"Select title,url,rank,votes from top_user Where sid='$site'",$db) or die (mysql_error());
if (!mysql_num_rows($get_rows) OR mysql_num_rows ($get_rows) < 1) { header("location: $url_to_folder"); }
$rows = mysql_fetch_array($get_rows);
if ($gateway == 1 AND $stat != "gate") {
if ($use_cookies == 1) {
setcookie ("test_cookies", "1",time()+(3600*$vote_timeout));
}
echo "<HTML>\n";
echo "<HEAD>\n";
echo "<meta name=\"robots\" content=\"all\">\n";
echo "<meta name=\"description\" content=\"Find the most popular sites based on traffic in desktop, free stuff, games, music, celebrities, and more.\">\n";
echo "<meta name=\"keywords\" content=\"top list sites sites links top web sites toplists top lists top list web directory the best sites webdirectory search engines searchengines portals free internet community send postcards free traffic free webpromotion linkexchange link exchange programs webmaster community webmaster affiliate programs computers free cliparts clip arts desktop themes free games free screensavers free wallpapers internet chat cool sites personal homepages webmasters animals crafts movies free mp3 music free cash freestuff free stuff greetingcards shopping women business free gsm telecom free webhosting free magazines cars celebrity celebrities free contests dogs education finance free fonts freeware free graphics health horoscopes jobs jokes free marketing midi pets free phones free free software free themes top websites top sites travel free videogames webcams webdesign webhosting entertainment\">\n";
echo "<meta name=\"revisit-after\" content=\"14 days\">\n";
echo "<title>Welcome to $top_name</title>\n";
echo "</HEAD>\n";
echo "<body bgcolor=\"#FFFFFF\" onLoad=\"if (self != top) top.location = self.location\">\n";
echo "<div align=\"center\"><font size=\"4\"><b>VOTA NELLA TOP DI EVULON - ZARYNA</b><br></font></div><br><br><br>\n";
[color=red]echo "<!-- Inizio codice rotazione banner mobydyck.com -->
<script language=\"JavaScript\">
<!--
var now = new Date();
var nIndex = now.getTime();
document.write('<center>');
document.write('<iframe src=\"http://www.dreamcastleweb.com/public/rotazionebanner/frbanner.php?action=display&id_set=1&page='+nIndex+'\" width=468 height=60 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no>');
document.write('<a href=\"http://www.dreamcastleweb.com/public/rotazionebanner/banner.php?action=go&id_set=1\" target=\"_blank\"><img border=0 src=\"http://www.dreamcastleweb.com/public/rotazionebanner.php?action=display&id_set=1&page='+nIndex+'\" width=468 height=60></a>');
document.write('</iframe><br>');
document.write('</center>');
// -->
</script>
<gmail notifier>
<center>
<iframe src=\"http://www.dreamcastleweb.com/public/rotazionebanner/frbanner.php?action=display&id_set=1&page=1\" width=468 height=60 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no>
<a href=\"http://www.dreamcastleweb.com/public/rotazionebanner/banner.php?action=go&id_set=1\" target=\"_blank\"><img border=0 src=\"http://www.dreamcastleweb.com/public/rotazionebanner/banner.php?action=display&id_set=1&page=1\" width=468 height=60></a>
</iframe><br>
</center>
</gmail notifier>
<!-- fine codice rotazione banner mobydyck.com -->";[/color] echo "<p align=\"center\"><font size='4'>Stai votando per il sito <b>$rows[title]</b><font></p>\n";
echo "<FORM ACTION=\"in.php\" METHOD=\"POST\">\n";
echo "<p align=\"center\"> </p>\n";
echo "<p align=\"center\">\n";
echo "<INPUT TYPE=\"IMAGE\" NAME=\"SUBMIT_IMAGE\" WIDTH=\"347\" HEIGHT=\"33\" ALT=\"VOTE TO $top_name\" src=\"images/enter.gif\"><BR>\n";
echo "</p>";
echo "<p align=\"center\"> </p>\n";
echo "<INPUT TYPE=\"HIDDEN\" NAME=\"site\" VALUE=\"$site\">\n";
echo "<INPUT TYPE=\"HIDDEN\" NAME=\"stat\" VALUE=\"gate\">\n";
echo "</FORM>\n";
echo "<div align=\"center\"><font size=\"3\">Se vuoi visitare la TOP senza votare, <a href=\"http://www.gollumsurf.com/top/\"> CLICCA QUI</a></font><br><br><br><br>\n";
echo "<div align=\"center\"><font size=\"2\"><b>Copyright Evulon - Zaryna</b> 2006</font></div>\n";
echo "</body>\n";
echo "</html>\n";
echo "";
}
else {
setcookie ("test_cookies", "1",time()+(3600*$vote_timeout));
}
if ($gateway == 1 && $REQUEST_METHOD == "POST" && isset($site)) {
if ($use_cookies == 1) {
setcookie ("test_cookies", "1",time()+(3600*$vote_timeout));
}
$cdate = date ("Ymd");
$err = 1;
$pdate = time()-(3600*$vote_timeout);
$cndate = time();
$query = mysql_db_query ($dbname,"Select ip from top_hits Where sid='$site' and cdate between $pdate and $cndate and ip='$REMOTE_ADDR'",$db) or die (mysql_error());
if ($err == 1 && @mysql_num_rows($query) >= 1) $err = 2;
if ($err == 1 && $use_cookies == 1) {
if ($anti_cheat[$site] == 1) $err = 2;
if ($test_cookies != 1) $err = 5;
}
if ($err == 1) {
if ($use_cookies == 1) {
setcookie ("anti_cheat[$site]", "1",time()+(3600*$vote_timeout));
}
mysql_db_query ($dbname,"update top_user set thin=thin+1 Where sid='$site'",$db) or die (mysql_error());
mysql_db_query ($dbname,"insert into top_hits (sid,ip) values ('$site','$REMOTE_ADDR')",$db) or die (mysql_error());
}
header("location: $url_to_folder/index.php?a_m=$err");
}
if ($gateway != 1) {
$cdate = date ("Ymd");
$pdate = time()-(3600*$vote_timeout);
$cndate = time();
$err = 1;
$query = mysql_db_query ($dbname,"Select ip from top_hits Where sid='$site' and cdate between $pdate and $cndate and ip='$REMOTE_ADDR'",$db) or die (mysql_error());
if ($err == 1 && @mysql_num_rows($query) >= 1) {
$err = 2;
if ($use_cookies == 1) {
setcookie ("anti_cheat[$site]", "1",time()+(3600*$vote_timeout));
}
}
if ($err == 1) {
if ($anti_cheat[$site] == 1) $err = 2;
}
if ($err == 1) {
if ($use_cookies == 1) {
setcookie ("anti_cheat[$site]", "1",time()+(3600*$vote_timeout));
}
mysql_db_query ($dbname,"update top_user set thin=thin+1 Where sid='$site'",$db) or die (mysql_error());
mysql_db_query ($dbname,"insert into top_hits (sid,ip) values ('$site','$REMOTE_ADDR')",$db) or die (mysql_error());
}
header("location: $url_to_folder/index.php?a_m=$err");
}
?> Le variabili sono chiare, almeno spero.
Ragazzi, veramente, è diventata una sfida all'ultimo ..."script".
Non può essere che vince lui.
Grazie comunque e un saluto sentito.









