Home > Backend Development > PHP Tutorial > php实现保存submit内容之后禁止刷新_php技巧

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-17 08:47:20
Original
963 people have browsed it
复制代码 代码如下:

$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。
复制代码 代码如下:






Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Why can’t my submit button submit data?
From 1970-01-01 08:00:00
0
0
0
Ajax click submit but no response!
From 1970-01-01 08:00:00
0
0
0
Click submit but nothing shows up
From 1970-01-01 08:00:00
0
0
0
git submit issue
From 1970-01-01 08:00:00
0
0
0
angular.js - angular's ng-submit does not trigger
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template