Parse Error: Parse Error, Unexpected T_CONSTANT_ENCAPSED_STRING In Line
- Forums
- PHP
- Parse Error: Parse Error, Unexpected T_CONSTANT_ENCAPSED_STRING In Line
This Page Contains information about Parse Error: Parse Error, Unexpected T_CONSTANT_ENCAPSED_STRING In Line By webune in category PHP with 0 Replies. [1036], Last Updated: Sat May 18, 2024
webune
Sun Jun 17, 2007
0 Comments
463 Visits
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.