RE: [PHP] <input type="text" value="He said, "How do I get this t o work?", with a frown" size="50">
| From: | Chris Shiflett | Date: | Tue, 16 Mar 2004 23:45:49 +0000 |
| Subject: | RE: [PHP] <input type="text" value="He said, "How do I get this t o work?", with a frown" size="50"> | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-180623@lists.php.net to get a copy of this message | ||
--- "Vail, Warren" <Warren.Vail@schwab.com> wrote:
> Ahh, because it's raw html and not in php.
>
> one choice would be to encapsulate it within php
>
> <input type="text" value="<?php echo "He said, \"How'm I
> gonna get
> this to work?\", with a frown";?>" size="50">
The problem with this is that PHP is server-side, so the following is sent
to the browser:
<input type="text" value="He said, "How'm I gonna get this to
work?", with a frown" size="50">
Thus, the same problem exists on the client-side, because the output is
identical.
To reiterate what others have stated, escaping quotes is good for PHP, and
HTML entities are good for HTML.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly
Coming mid-2004
HTTP Developer's Handbook - Sams
http://httphandbook.org/
PHP Community Site
http://phpcommunity.org/