= 1) { $voteValid = 0; // ถ้า พบ ip ซ้ำ } else { $voteValid = 1; // ถ้า ไม่พบ ip ซ้ำ } $ctime = time(); $chkcookie = "st".$_GET['id']; //ตรวจสอบการสั่งโหวต if ($_COOKIE[$chkcookie] == md5(getenv("REMOTE_ADDR"))) { //โหวตเพิ่มคะแนน if ($_GET['vote'] == "1"){ if($voteValid==1) { $db = mysql_connect($CFGDB['host'],$CFGDB['username'],$CFGDB['password']) or die ("connect fail"); mysql_db_query($CFGDB['dbname'],"INSERT INTO {$CFGDB['prefix']}vote (VoteIdMem,VoteIp,VoteTime) VALUES ('{$_GET['id']}','{$ip}', '{$ctime}')"); mysql_close($db); $voteValid = "1"; $db = mysql_connect($CFGDB['host'],$CFGDB['username'],$CFGDB['password']) or die ("connect fail"); mysql_db_query($CFGDB['dbname'],"UPDATE {$CFGDB['prefix']}members SET MemPoint=MemPoint+{$CFG['point_vote']} WHERE MemId='{$_GET['id']}'"); mysql_close($db); $ThankVoteResult = $CFG['show_vote_plus']; } else { $ThankVoteResult = $CFG['show_not_vote']; } } //โหวตลบคะแนน if ($_GET['vote'] == "2") { if($voteValid==1) { $db = mysql_connect($CFGDB['host'],$CFGDB['username'],$CFGDB['password']) or die ("connect fail"); mysql_db_query($CFGDB['dbname'],"INSERT INTO {$CFGDB['prefix']}vote (VoteIdMem,VoteIp,VoteTime) VALUES ('{$_GET['id']}','{$ip}', '{$ctime}')"); mysql_close($db); $voteValid = "1"; $db = mysql_connect($CFGDB['host'],$CFGDB['username'],$CFGDB['password']) or die ("connect fail"); mysql_db_query($CFGDB['dbname'],"UPDATE {$CFGDB['prefix']}members SET MemPoint=MemPoint-{$CFG['point_vote']} WHERE MemId='{$_GET['id']}'"); mysql_close($db); $ThankVoteResult = $CFG['show_vote_minus']; } else { $ThankVoteResult = $CFG['show_not_vote']; } } } else { $ThankVoteResult = "คุณทำการ Vote ไม่ถูกต้อง"; } ?> <?=$CFG['title']?>
แสดงทั้งหมด |


กลับสู่หน้าที่แล้ว