Forum Moderators: coopster

Message Too Old, No Replies

Parse error in echo statement

unexpected T_ENCAPSED_AND_WHITESPACE

         

moosken

6:54 pm on May 30, 2007 (gmt 0)

10+ Year Member



Hi. I'm currently developing a site and am making an "update form". I have the following code but PHP is bringing up the error:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING on line 72

Below is the code relating to these lines:

<form method=\"post\" action=\"newphotoform2.php\">
<label for=\"Owlname\">Owlname&nbsp;</label><input type=\"text\" name=\"Owlname\" id=\"Owlname\" size=\"15\" maxlength=\"15\" value=\"$row2['owlname']\"><br/><br/>
<label for=\"Description\">Description&nbsp;</label><textarea name=\"Description\" id=\"Description\" rows=\"8\" cols=\"27\">$row2['description']</textarea><br/><br/>
<fieldset>
<legend>Category</legend>

I'd be grateful if someone could help me out. Thanks.

eelixduppy

6:57 pm on May 30, 2007 (gmt 0)



Welcome to WebmasterWorld!

Making some assumptions on what actually is coming before this code, my guess is that the arrays within the string are giving you the problem. Try changing what you have given to this:


<form method=\"post\" action=\"newphotoform2.php\">
<label for=\"Owlname\">Owlname&nbsp;</label><input type=\"text\" name=\"Owlname\" id=\"Owlname\" size=\"15\" maxlength=\"15\" value=\"{$row2['owlname']}\"><br/><br/>
<label for=\"Description\">Description&nbsp;</label><textarea name=\"Description\" id=\"Description\" rows=\"8\" cols=\"27\">{$row2['description']}</textarea><br/><br/>
<fieldset>
<legend>Category</legend>

Just a note: When you include arrays within a string, you must either surround it with brackets ({ and }) or you must concatenate it with the string.

Read up on this at the documentation: [us.php.net...]

Good luck! :)