Link to home
Start Free TrialLog in
Avatar of Larry Vollmer
Larry Vollmer

asked on

Syntax Question

<? echo "<p>Review Text - You can edit this text: <br /><textarea cols=\"40\" rows=\"6\" name=\"reviewtext\" value =\".$rs['reviewtext'];?>.\" /></textarea></p>

I keep getting an error Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING


I know I have an error around the "Value" part but I can't figure out what the problem is. Can anyone help out?
Avatar of syedasimmeesaq
syedasimmeesaq
Flag of United States of America image

try this
echo "<p>Review Text - You can edit this text: <br /><textarea cols=\"40\" rows=\"6\" name=\"reviewtext\" value =\".$rs['reviewtext'];?>.\"" /></textarea></p>
ASKER CERTIFIED SOLUTION
Avatar of hernst42
hernst42
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
other option is to use {.. } for the variablename and not to use string concatenation

<? echo "<p>Review Text - You can edit this text: <br /><textarea cols=\"40\" rows=\"6\" name=\"reviewtext\" value =\"{$rs['reviewtext']}\"";?> /></textarea></p>
Avatar of Larry Vollmer
Larry Vollmer

ASKER

thanks guys
Avatar of hielo
the value for a textares does NOT go withing a value attribute. It needs to go between <textarea> and </textarea>. This is what you need (copy and paste from here):
<?php echo "<p>Review Text - You can edit this text: <br /><textarea cols=\"40\" rows=\"6\" name=\"reviewtext\">{$rs['reviewtext']}</textarea></p>";
hielo is right, i was wondering what I was doing wrong. perhaps I can get you some points.
hielo - i get this error with that line of code:

Parse error: syntax error, unexpected '<' in /home/venuereview/approve.php on line 194
never mind, I didn't close the php
it still says it is closed?