简体   繁体   English

php参数没有被调用

[英]php params not getting called

I have link as test.php?fullname=Fahim&emailid=test@test.com 我有链接作为test.php?fullname=Fahim&emailid=test@test.com

In test.php I have below 在test.php我有下面

$fullname = $_POST['fullname'];
$emailid = $_POST['emailid'];

echo "$fullname===$emailid===";

I always get response as ====== 我总是以======获得回应

I was expecting as Fahim===test@test.com . 我期待的是Fahim===test@test.com

Any idea why this is happening? 知道为什么会这样吗?

在test.php中,将使用$ _GET接收数据,因为您正在使用URL发送数据

Your link test.php?fullname=Fahim&emailid=test@test.com 您的链接test.php?fullname=Fahim&emailid=test@test.com

$fullname = $_GET['fullname'];
$emailid = $_GET['emailid'];
echo "$fullname===$emailid===";

Output 产量

Fahim===test@test.com

You have to use $_GET['param_name'] to retrive values sending via url. 您必须使用$_GET['param_name']来检索通过url发送的值。

When you pass parameters from the url, it is a get request.. 当您从网址传递参数时,这是一个获取请求。

In PHP, we use $_GET for fetching information from get request 在PHP中,我们使用$_GET从get请求中获取信息

$fullname = $_GET['fullname'];
$emailid = $_GET['emailid'];

echo "$fullname===$emailid===";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM