Home > Backend Development > PHP Tutorial > PHP交付form遇到语法报错

PHP交付form遇到语法报错

WBOY
Release: 2016-06-13 13:22:24
Original
998 people have browsed it

PHP提交form遇到语法报错
我的form是这么写的,目的是在同一页面完成数据更新,所以用了:action="test.php?action=add"

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
Copy after login
《内容省略》


然后捕捉该FORM的action:

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
Copy after login


然后,在浏览器测试,报错:

  Notice: Undefined index: Action in D:\setup\xampp\htdocs\test.php on line 133
《这一行的内容正是:if($_GET["Action"]=="Add")》

查了很久,不知道是哪里错了。



------解决方案--------------------
第一个 传递get 的话要像 3楼这么改
第二个传递的值需要写

if(isset($_GET["action"]))
这么进行判断

那个是一个提示 ,修改后提示就会消失。如果你不修改 修改php.ini的出错提示等级也可以达到目的。
------解决方案--------------------
探讨

引用:
if($_GET["action"]=="Add")


不行!还是报错
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