Home  >  Article  >  Backend Development  >  PHP prohibits refreshing after saving submit content_PHP tutorial

PHP prohibits refreshing after saving submit content_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:35:38697browse

Copy code The code is as follows:

$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>';

The key point is the last sentence. After inserting, reload the page, add parameters, and then write on the page A judgment, and the GET parameter is disabled when it is 1.
Copy code The code is as follows:



< ; ?php }else{?>


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/743579.htmlTechArticleCopy the code as follows: $strsql = "INSERT INTO `xxx` (`aaa`) VALUES ('". $_POST["bbb"]."','".$_POST["ccc"]."',,now())"; $result=@mysql_query($strsql,$my_con); $maxrow=@mysql_affe ...
Statement:
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