[php]<?php
$ip = getenv(“REMOTE_ADDR”);
$sql0 = mysql_query(“SELECT ip FROM votes WHERE ip=’”.$ip."’");
mysql_num_rows($sql0);
if(mysql_num_rows($sql0) != 1)
{
mysql_query(“INSERT INTO votes(ip) VALUES (’”.$ip."’)");
}
//////////////////////
// CONFIG
$points = 5;
$vote_time = 12 * 3600;
$new_time = time() + $vote_time;
// END
//////////////////////
if($_GET[‘vote’])
{
if($_GET['vote'] == "xtop")
{
$vote_site = "http://www.xtremetop100.com/in.php?site=1132321739";
}else {
$vote_site = "http://www.gtop100.com/in.php?site=61474s";
}
$site = $_GET['vote'];
$sql2 = mysql_query("SELECT ".$site."_time FROM votes WHERE ip='".$ip."'");
$res2 = mysql_fetch_array($sql2);
if(time() > $res2[$site."_time"]){
mysql_query("UPDATE votes SET ".$site."_time='".$new_time."' WHERE ip='".$ip."'");
mysql_query("UPDATE votes SET ".$site."_count=".$site."_count+1 WHERE ip='".$ip."'");
mysql_query("UPDATE accounts SET, donation_points=donation_points+'".$row['reward']."' WHERE username='".$_SESSION['account']."'");
echo '<meta http-equiv="refresh" content="0;'.$vote_site.'" />';
}
}
$sql3 = mysql_query("SELECT * FROM votes WHERE ip='".$ip."'");
$row3 = mysql_fetch_array($sql3);
$gtime = $row3[1];
$xtime = $row3[3];
?>
Vote for Donation Points
</ center><a href="?p=vote&vote=gtop"><center>
<img src="http://www.gtop100.com/images/votebutton.jpg" />
</center></a>
<center><?php
if(!$gtime < time()){
$left = $gtime - time();
$hours = $left / 3600;
settype($hours , "integer");
echo "You have to wait ".$hours." Hours before u can vote again";
} else {
echo "You are able to vote now!";
}
?></center>
<br />
</p>
<p>
<a href="?p=vote&vote=xtop"><center>
<img src="http://www.xtremetop100.com/votenew.jpg" />
</center></a>
<center><?php
if(!$xtime < time()){
$left = $xtime - time();
$hours = $left / 3600;
settype($hours , "integer");
echo "You have to wait ".$hours." Hours before u can vote again";
} else {
echo "You are able to vote now!";
}
?></center>
</p>[/php]
pls help… i want this to be fix. this is a website voting script
the tables are in Accounts.sql and it name as donation_points
help pls help