Solved

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING

Posted on 2011-02-10
3
461 Views
Last Modified: 2013-12-13
Can someone help me figure out why I get a parse error with this string? Thanks.

$output.= ' onclick="this.value=''" />';

Open in new window


0
Comment
Question by:kadin
3 Comments
 
LVL 2

Accepted Solution

by:
requeue earned 250 total points
ID: 34867175
You have to escape single quote in the text.

$output.= ' onclick="this.value=\'\'" />';

Open in new window

0
 
LVL 27

Assisted Solution

by:yodercm
yodercm earned 250 total points
ID: 34867188
$output.= ' onclick="this.value='.'" />';

You need a concatenation between the two quotes sections.
0
 

Author Closing Comment

by:kadin
ID: 34867255
Thank you both.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

756 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