jquery 防止submit重复提交

$code = mt_rand(0,1000000);
setcookie('addtips',$code,time()+300);
if(isset($_POST['cmd']) ){
if($_COOKIE['addtips']!= $_POST['code']){  //arrest  Refresh or Reload submit
echo '< script type="text/javascript">// ';
die;
}
}
$smarty->assign('code',$code);

//html code

发表评论