Solved

Syntax Question

Posted on 2008-06-10
11
233 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
  • 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 250 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 250 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
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…
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 dynamically set the form action using jQuery.

777 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