php params not getting called

梦想的初衷 提交于 2019-12-11 18:38:11

问题


I have link as test.php?fullname=Fahim&emailid=test@test.com

In test.php I have below

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

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

I always get response as ======

I was expecting as Fahim===test@test.com.

Any idea why this is happening?


回答1:


In test.php data will be recieved using $_GET cause you are sending data using URL




回答2:


Your link 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.




回答3:


When you pass parameters from the url, it is a get request..

In PHP, we use $_GET for fetching information from get request

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

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


来源:https://stackoverflow.com/questions/17675222/php-params-not-getting-called

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!