利用PHP的Session功能,也能避免重复提交表单。Session保存在服务器端,在PHP运行过程中可以改变Session变量,下次访问这个变量时,得到的是新赋的值,所以,可以用一个Session变量记录表单提交的值,如果不匹配,则认为是用户在重复提交。A页面的代码:<?php session_start(); //根据当前SESSION生成随机数 $code = mt_rand(0,1000000); $_SESSION['code'] = $code; //将此随机数暂存入到session ?> <form id="form1" name="form1" method="post" action="t2.php"> <p>说明 <input type="text" name="titile" /> <input type="hidden" name="originator" value="<?php echo $co
Hawk
别固执的认为某事必须 !