RE: [PHP] " in data
| From: | Chris W. Parker | Date: | Fri, 18 Jun 2004 20:18:34 +0000 |
| Subject: | RE: [PHP] " in data | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-188611@lists.php.net to get a copy of this message | ||
Robert Sossomon <mailto:robert@gcnorris.com>
on Friday, June 18, 2004 12:30 PM said:
> My code for extraction:
> $item_desc = addslashes($Quote['sel_item_desc']);
you don't need to addslahes() when retrieving. just htmlentities() the
data before you display it.
do a simple test:
<?php
$data = 'hello. some "data" is here';
// shouldn't work
echo "<input type="text" value="$data" />";
$data = htmlentities($data);
// should work
echo "<input type="text" value="$data" />";
?>
chris.