标题 | php实现保存submit内容之后禁止刷新 |
内容 | 这篇文章主要介绍了php保存submit内容之后禁止刷新的具体实现,需要的朋友可以参考下 代码如下: $strsql = "INSERT INTO `xxx` (`aaa`) VALUES ('".$_POST["bbb"]."','".$_POST["ccc"]."',,now())"; $result=@mysql_query($strsql,$my_con); $maxrow=@mysql_affected_rows(); Testecho ($y.mysql_affected_rows()." $errcode ".$strsql); #debug mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__); if($maxrow>0){ $insertflag =1; } echo '<script>location.href="6612.php?inserted=1"</script>'; 重点是最后一句,在insert完之后,重新载入一次页面,并且加上参数,然后在页面上写个判断,又GET的参数并且为1的时候disabled。 代码如下: <?php echo $insertflag;print_r($_GET); if($_GET[inserted]!=1){?> <input type="submit" value="新規登録" name="insertN"></input> <?php }else{?> <input type="botton" value="新規登録" name="insertN" disabled></input> <?php }?> |
随便看 |
|
在线学习网考试资料包含高考、自考、专升本考试、人事考试、公务员考试、大学生村官考试、特岗教师招聘考试、事业单位招聘考试、企业人才招聘、银行招聘、教师招聘、农村信用社招聘、各类资格证书考试等各类考试资料。