当前位置: 移动技术网 > IT编程>开发语言>PHP > php实现保存submit内容之后禁止刷新

php实现保存submit内容之后禁止刷新

2019年03月28日  | 移动技术网IT编程  | 我要评论

百变大咖秀 she,www.0578.cm,羽球共和国

复制代码 代码如下:

$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" class="box1a"></input>
<?php }else{?>
<input type="botton" value="新規登録" name="insertn" class="box1a" disabled></input>
<?php }?>

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网