今天我們來看看限制同IP注冊人數代碼的代碼吧,注要用到datediff 函數哦,很簡單的.
$ex_sql =mysql_query("Select * from wk_member where m_ip='$ip' and datediff(m_dtime,'$dtime')=0");
if(mysql_num_rows($ex_sql)<5){
$sql;
if(mysql_query($sql)){
$_SESSION['uid']=array(mysql_insert_id(),$uid,$mo);
exit("<script>location='registerok.php';</script>");
}else{
alert('注冊失敗!','');
}
}else{
alert('對不起,同IP一天只能注冊5個用戶','');
}
這樣就可以做投票限制IP的程序了,哈哈最後本站原創轉載請注明www.111cn.cn/phper/php.html