RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
phpcookie控制提交频率
         //我要提问基于tp3.2
            public function tiwen(){
                $cityId = parent::$cityId;//区分城市id
                $typeDb=D("FangType");
                $typeData=$typeDb->getConfig(36,$cityId);
                $this->assign("typeData",$typeData);
                if($_POST){
                $db = D("EsfAsk");
                $userid=  $this->userId;
                $asktypeid=I('asktypeid');
                $asktitle=I('asktitle');
                $data['askType'] = $asktypeid;
                $data['askTitle'] = $asktitle;
                $data['description'] =$asktitle;
                $data['askTime'] = time();
                $cookie = cookie('bresfwd');
                cookie('bresfwd',"Y",array('expire'=>60));
                if($cookie){
                      $this->success('提交过于频繁');
                } 
               
                
                $data['cityId']=$cityId;
                $data['userId'] = $userid;
                $data['isAnswer'] = 'N';
                $data = $db->add($data);
                if ($data) {
                    $this->success('提交成功');
                } else {
                    $this->success('提交失败');
                }
             }
                $this->display(); 
            }
js代码: