- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
[2 Cubi Gold] <a target="_blank" href="index.php?vote=xtreme">xtremetop.com</a>
<?php
if ($_GET["vote"] == "xtreme")
{
$host='localhost';
$database='pw';
$user='root';
$pswd='password';
$dbh = mysql_connect($host, $user, $pswd) or die("Не могу соединиться с MySQL.");
mysql_select_db($database) or die("Не могу подключиться к базе.");
$search=CAuth::getLoggedName();
$search=mysql_real_escape_string($search);
$query="SELECT xtreme FROM `users` where name='".$search."'";
$res = mysql_query($query);
$row = mysql_fetch_row($res);
$dateVote=strtotime($row[0]);
$dateVote2=$row[0];
$nullDate="0000-00-00 00:00:00";
$nullDate = strtotime($nullDate);
$now=date("Y-m-d H:i:s");
$now=mysql_real_escape_string($now);
if($dateVote==$nullDate)
{
$query="UPDATE users SET xtreme='$now' WHERE name='$search'";
$query = mysql_query($query);
//запись в лог и редирект
$log_file="/var/www/html/log.txt";
$f=fopen($log_file,"a+");
$ip=getenv("REMOTE_ADDR");
fputs($f, "\n325325253\t" .date("d.m.Y H:i:s").' '.$ip."\t".CAuth::getLoggedName().' '."\t1");
fclose($f);
echo "\nYou will be redirected to xtremetop...";
echo "<meta http-equiv='Refresh' content='3;URL=http://google.ru'>";
}
else if ((strtotime($now)-strtotime($dateVote2)) < 21600)
{
echo "You can't vote. Please wait ",21600 - (strtotime($now)-strtotime($dateVote2))," seconds.";
}
else
{
$query="UPDATE users SET xtreme='$now' WHERE name='$search'";
$query = mysql_query($query);
//запись в лог и редирект
$log_file="/var/www/html/log.txt";
$f=fopen($log_file,"a+");
$ip=getenv("REMOTE_ADDR");
fputs($f, "\n325325253\t" .date("d.m.Y H:i:s").' '.$ip."\t".CAuth::getLoggedName().' '."\t1");
fclose($f);
echo "\nYou will be redirected to xtremetop...";
echo "<meta http-equiv='Refresh' content='3;URL=http://google.ru'>";
}
}
?>