织梦DEDECMS自定义表单限制IP发表次数

  • A+
所属分类:建站相关
打开plus下diy.php文件
找到

  1. if(!is_array($diyform))
  2. {
  3. showmsg('自定义表单不存在', '-1');
  4. exit();
  5. }
再其下添加

  1. //检测游客是否已经提交过表单
  2. if(isset($_COOKIE['VOTE_MEMBER_IP']))
  3. {
  4. if($_COOKIE['VOTE_MEMBER_IP'] == $_SERVER['REMOTE_ADDR'])
  5. {
  6. ShowMsg('您已经填写过表单啦','-1');
  7. exit();
  8. } else {
  9. setcookie('VOTE_MEMBER_IP',$_SERVER['REMOTE_ADDR'],time()*$row['spec']*3600,'/');
  10. }
  11. } else {
  12. setcookie('VOTE_MEMBER_IP',$_SERVER['REMOTE_ADDR'],time()*$row['spec']*3600,'/');
  13. }

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

私密评论