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?
lvollmerAsked:
Who is Participating?
 
hernst42Connect With a Mentor Commented:
ther is missing a " before the .$rs and after it. Should look like:

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

Open in new window

0
 
syedasimmeesaqCommented:
try this
echo "<p>Review Text - You can edit this text: <br /><textarea cols=\"40\" rows=\"6\" name=\"reviewtext\" value =\".$rs['reviewtext'];?>.\"" /></textarea></p>
0
 
syedasimmeesaqConnect With a Mentor Commented:
oops

here

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

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
hernst42Commented:
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>
0
 
lvollmerAuthor Commented:
thanks guys
0
 
hieloCommented:
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>";
0
 
lvollmerAuthor Commented:
hielo is right, i was wondering what I was doing wrong. perhaps I can get you some points.
0
 
lvollmerAuthor Commented:
hielo - i get this error with that line of code:

Parse error: syntax error, unexpected '<' in /home/venuereview/approve.php on line 194
0
 
lvollmerAuthor Commented:
never mind, I didn't close the php
0
 
lvollmerAuthor Commented:
it still says it is closed?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.