How to prevent PHP form from refreshing and submitting, PHP form refresh and submit_PHP tutorial

WBOY
Release: 2016-07-12 09:05:19
Original
848 people have browsed it

How to prevent refresh submission of PHP form, PHP form refresh submission

Excerpted from http://bbs.chinaunix.net/thread-667547-1-1.html

------------------------------------------------- -----------------------

When outputting the form page: (Give me an example, it’s not perfect)
$intFlag = md5(time());
$strFlag = 'flag_$intFlag';
$_SESSION["$strFlag"] = 1;


Then when accepting data:
$action_flag = trim($_POST["action_flag"]);
if ($action_flag!="" && $_SESSION["$action_flag"]==1)
{
$_SESSION["$action_flag"] = 2;
//Process data
}
else
{
die("Duplicate submission or other errors");
}

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1069671.htmlTechArticleHow to prevent refresh submission of PHP form, PHP form refresh submission is taken from http://bbs.chinaunix.net/thread -667547-1-1.html ------------------------------------------------ -----------------------...
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!