?
Solved

Syntax Question

Posted on 2008-06-10
11
Medium Priority
?
251 Views
Last Modified: 2010-04-21
<? 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
Comment
Question by:lvollmer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
  • 2
  • +1
11 Comments
 
LVL 9

Expert Comment

by:syedasimmeesaq
ID: 21753855
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
 
LVL 48

Accepted Solution

by:
hernst42 earned 1000 total points
ID: 21753863
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
 
LVL 9

Assisted Solution

by:syedasimmeesaq
syedasimmeesaq earned 1000 total points
ID: 21753864
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
WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

 
LVL 48

Expert Comment

by:hernst42
ID: 21753883
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
 

Author Closing Comment

by:lvollmer
ID: 31465875
thanks guys
0
 
LVL 82

Expert Comment

by:hielo
ID: 21753927
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
 

Author Comment

by:lvollmer
ID: 21754703
hielo is right, i was wondering what I was doing wrong. perhaps I can get you some points.
0
 

Author Comment

by:lvollmer
ID: 21754730
hielo - i get this error with that line of code:

Parse error: syntax error, unexpected '<' in /home/venuereview/approve.php on line 194
0
 

Author Comment

by:lvollmer
ID: 21754782
never mind, I didn't close the php
0
 

Author Comment

by:lvollmer
ID: 21759821
it still says it is closed?
0

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question