Heim  >  Artikel  >  Backend-Entwicklung  >  php实现保存submit内容之后禁止刷新_PHP教程

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

WBOY
WBOYOriginal
2016-07-13 10:35:38698Durchsuche

复制代码 代码如下:

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






www.bkjia.comtruehttp://www.bkjia.com/PHPjc/743579.htmlTechArticle复制代码 代码如下: $strsql = "INSERT INTO `xxx` (`aaa`) VALUES ('".$_POST["bbb"]."','".$_POST["ccc"]."',,now())"; $result=@mysql_query($strsql,$my_con); $maxrow=@mysql_affe...
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn