[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 255
  • Last Modified:

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?
0
lvollmer
Asked:
lvollmer
  • 5
  • 2
  • 2
  • +1
2 Solutions
 
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
 
hernst42Commented:
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:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 5
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now