0

i am getting value from url, URL is like below

 http://*****/test.php?register=true$gcm_regid=Amit&[email protected]&email=asdxcvxcvxzcvxc

and i am printing that value by below code

$gcm_regid = $_GET["gcm_regid"];
$name = $_GET["name"]
$email = $_GET["email"]
echo $name; ======>this is line 14-<==========

but i am getting error like

     Parse error: syntax error, unexpected T_VARIABLE in /******/test.php on line 14

4 Answers 4

2

Simply enough, you're missing semicolons after the $name and $email lines.

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

Comments

0

You are missing the semicola ; after $_GET["name"] and $_GET["email]

$gcm_regid = $_GET["gcm_regid"];
$name = $_GET["name"];
$email = $_GET["email"];
echo $name;

Comments

0

Your missing semicolons. and

http://*****/test.php?register=true$gcm_regid=Amit&[email protected]&email=asdxcvxcvxzcvxc

In this link you are using $ symbol instead of &. change $gcm_regid to &gcm_regid

Comments

0

Simply, There are two Problems, 1st one, you are missing semicolons,

$name = $_GET["name"]
$email = $_GET["email"]

& 2nd one, problem is in url passing elements,

http://*****/test.php?register=true$gcm_regid=Amit&[email protected]&email=asdxcvxcvxzcvxc

Change this line to this,

http://*****/test.php?register=true&gcm_regid=Amit&[email protected]&email=asdxcvxcvxzcvxc

The mistake is "true$gcm_regid", it will come as "true&gcm_regid"

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.