0

I have link as test.php?fullname=Fahim&[email protected]

In test.php I have below

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

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

I always get response as ======

I was expecting as [email protected].

Any idea why this is happening?

1
  • 2
    That's $_GET not $_POST Commented Jul 16, 2013 at 11:25

3 Answers 3

2

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

Sign up to request clarification or add additional context in comments.

3 Comments

earlier everything was working.. all of sudden dnt know today problem is coming...
$_POST will only work if the data is POSTed to the script, putting it in the URL is not POST, so perhaps you used to use a form to submit the information
you have to first check also that your form method is GET only
1

Your link test.php?fullname=Fahim&[email protected]

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

Output

[email protected]

You have to use $_GET['param_name'] to retrive values sending via url.

Comments

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===";

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.