Home > Backend Development > PHP Tutorial > PHP multiple submit submission form processing method_PHP tutorial

PHP multiple submit submission form processing method_PHP tutorial

WBOY
Release: 2016-07-21 15:45:36
Original
1191 people have browsed it

test.php

复制代码 代码如下:

$test = $_POST[ 'test '];
echo '12 ';
echo $test;
echo $_POST[ 'submit1 '];
echo $_POST[ 'submit2 '];
if (isset($_POST[ 'submit1 ']) && $_POST[ 'submit1 '] == 'submit1 ')
{
echo 'ok1 ';

}
if (isset($_POST[ 'submit2 ']) && $_POST[ 'submit2 '] == 'submit2 ')
{
// echo " ";
// header( "Location:index.php ");
// break;
echo 'ok2 ';
}
?>


复制代码 代码如下:











为什么 这个测试页面 载入后第一次不传数据?
echo $_POST[ 'submit1 '];echo $_POST[ 'submit2 '];都打印空
之后就好了。这个是什么原因 有没有办法解决?
方法二:





www.bkjia.comtruehttp://www.bkjia.com/PHPjc/320318.htmlTechArticletest.php 复制代码 代码如下: ?php $test = $_POST[ 'test ']; echo '12 '; echo $test; echo $_POST[ 'submit1 ']; echo $_POST[ 'submit2 ']; if (isset($_POST[ 'submit1 ']) $_POST[...
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