PHP prohibits refreshing after saving submit content_PHP tutorial

WBOY
Release: 2016-07-13 10:35:38
Original
725 people have browsed it

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 ...
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!