Home > Backend Development > PHP Tutorial > 新手,问一个PHP提交给本页的有关问题

新手,问一个PHP提交给本页的有关问题

WBOY
Release: 2016-06-13 10:27:36
Original
807 people have browsed it

新手,问一个PHP提交给本页的问题
如下一段代码,我想提交给本页来处理,但是不正确,请教应当怎么写呢?

echo 'aaaa=';
if (isset($_POST['add']))
{
echo "bbbb";
}
?>




status:



 

    

 
 



------解决方案--------------------

红色部分,多写了一个等号。

吐槽一下:任何浏览器都不应该纵容如此垃圾的html代码。
------解决方案--------------------
这样写就行:



status:




    

 


echo 'aaaa=';
if($act == 'act')
{
$status= !empty($_POST['status']) ? trim($_POST['status']) : '';
...
}
?>
------解决方案--------------------
探讨
如下一段代码,我想提交给本页来处理,但是不正确,请教应当怎么写呢?

echo 'aaaa=';
if (isset($_POST['add']))
{
echo "bbbb";
}
?>


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