Parse Error: Parse Error, Unexpected T_CONSTANT_ENCAPSED_STRING In Line
parse error: parse error, unexpected t_constant_encapsed_string in line
parse, error, parse, error, unexpected, t, constant, encapsed, string, in, line
Parse Error: Parse Error, Unexpected T_CONSTANT_ENCAPSED_STRING In Line
Post Description: parse error: parse error, unexpected t_constant_encapsed_string in line
POST# 408
Posted On: Fri Feb 29, 2008 12:01 pm
webune
Topic: Parse Error: Parse Error, Unexpected T_CONSTANT_ENCAPSED_STRING In Line
if you are getting this error is because you have an error on you PHP script.
this is the error i got:

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/www/htdocs/anything/secured/html/index.php on line 148



for example, i was writing a script to connect to my database and this is what i had on the line the trouble was given:
$sql = "update ".$db_prefix."config set ".$_GET['field']."='".$_POST'value']."' where ".$_GET['field']."=".$_GET['field']."";

then i changed it to this:
$sql = "update ".$db_prefix."config set ".$_GET['field']."='".$_POST['value']."' where ".$_GET['field']."=".$_GET['field']."";

and it worked.

can you tell what i changed to fix the problem in the error on my code?

no, well, i am going to tell you, i was missing a [ on the $_POST['value'] variable, if you look on the first example, you will see that i have $_POST'value'] but i should really have it like this $_POST['value']

so check your code, you have a bad syntax, that's all.

if you need php hosting, you should visit webune.com i host with them and they were able to help me with this error i was having on my php script.


No Repies
(0) Comments for Parse Error: Parse Error, Unexpected T_CONSTANT_ENCAPSED_STRING In Line

What do you think?

* name:  

* email:  

* Please enter comments:


Receive Replies on my Comments
(An email will be sent to you when someone replies to your comments)

Add image to comments
yes no             upload