<?php
define('INCLUDE_CHECK',true);
error_reporting(0);
session_name('tzLogin');
session_start();
$user = $_SESSION['name'];
if($user or die('Please login to continue')) {
mysql_connect("localhost","root","password");
mysql_select_db('db_account');
require_once 'Functions/Import.php';
$l = isset ( $_GET [ 'l' ] ) ? $_GET [ 'l' ] : null ;
if ( ! is_null ( $l ) ) {
$gd= mysql_query("SELECT * FROM t_account WHERE name='$user' AND (now() - INTERVAL 6 HOUR > lastvoted)");
if($gd or die("Come back later you still have time left to vote"))
{
$qry = "UPDATE t_account SET `vo` = `vo` + 1, `lastvoted` = now() WHERE name='$user'";
$result = @mysql_query($qry);
}
else {
}
header ( 'Location: ' . base64_decode ( $l ) , true , 301 ) ;
exit ;
}
}
?>
我没有得到所需的结果。
嗯,我试过你告诉我的,我用这种方式编写代码
但仍然执行查询而不是给出消息“稍后回来”查询应该只在存储时间比实时时间早 6 小时时才有效
:(请帮帮我