--- Scott Fletcher <[EMAIL PROTECTED]> wrote:
> I'm using data that goes from the HTML textbox to PHP to MYSQL to
> PHP to HTML textbox.  The only trouble I have is to escape the
> apostrophe character when it is put into the HTML textbox by PHP
> (from MySQL).
> 
> --snip--
>   echo "<input type='textbox' value='".$value."'>";
> --snip--

You could quote your attributes like I do:

<input type="text" value="foo" />

Then apostrophes won't be a problem. :-)

The better answer is to use HTML entities. There's a nice function called
htmlentities() that can help with this.

> I can't use the HTML feature like &quot or something because the
> "&quot" would show up in the database...  Any suggestion or advice?

As they say, timing is everything.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
     Coming Fall 2004
HTTP Developer's Handbook - Sams
     http://httphandbook.org/
PHP Community Site
     http://phpcommunity.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to