By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,956 Members | 1,683 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,956 IT Pros & Developers. It's quick & easy.

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING

P: 16
hello, can anyone help me please am getting the following error
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in D:\wamp\www\hello.php on line 92

below is the line of code 92 with the error:

print " <form method=post action='hello.php?question=3&score=$_GET['score']'>$question2</form>";
Oct 13 '11 #1
Share this Question
Share on Google+
4 Replies


100+
P: 1,059
if you use print then you must have to use bracket. you can use echo instead of print
Oct 13 '11 #2

P: 59
johny is right and i also think u re using ur quotes wrongly u used a single quote to open the action and then inside again u re using it in $_GET[] to php thats like close quote open new quote why dont u remove the outter quotes i.e action=hello.phpquestion=3&score=$_GET['score''
Oct 13 '11 #3

Dormilich
Expert Mod 5K+
P: 8,639
associative array elements need to be put in curly braces when inside a string:
Expand|Select|Wrap|Line Numbers
  1. print " <form method=post action='hello.php?question=3&score={$_GET['score']}'>$question2</form>";
Oct 14 '11 #4

P: 16
Thank you very much guys,problem solved it was the missing curly braces thank you again dormilich.
Oct 14 '11 #5

Post your reply

Sign in to post your reply or Sign up for a free account.