Home >php教程 >php手册 >限制同IP注册人数代码

限制同IP注册人数代码

WBOY
WBOYOriginal
2016-06-13 10:09:53844browse

今天我们来看看限制同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)     $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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn