0

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?

Fahim Parkar
  • 30,974
  • 45
  • 160
  • 276

3 Answers3

2

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

Rohitashv Singhal
  • 4,517
  • 13
  • 57
  • 105
1

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.

웃웃웃웃웃
  • 11,829
  • 15
  • 59
  • 91
1

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===";
tenstar
  • 9,816
  • 9
  • 24
  • 45