Home > Backend Development > PHP Tutorial > PHP在使用post传递数据时,action="login.php?id=2",点击提交,$_POST["id"]无法显示,即没有被设置!

PHP在使用post传递数据时,action="login.php?id=2",点击提交,$_POST["id"]无法显示,即没有被设置!

WBOY
Release: 2016-06-23 14:16:19
Original
1881 people have browsed it

PHP Form action $_POST[]

PHP在使用post传递form表单数据时,设置action="login.php?id=2",
点击提交,使用$_POST["id"]无法显示,即没有被设置!但是其他的,
比如$_POST["name"]的值是存在的

原计划是通过id的值进行判断,然同一个php页面处理不同的请求,
请大家帮帮忙!

有钱的捧个钱场,有人的捧个人场。

回复讨论(解决方案)

url上面的参数得用 $_GET['id'];

url上面的参数得用 $_GET['id'];
一言惊醒梦中人呀!
仅仅代表全世界人民对你感谢!

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