Silly Question Sorted
| From: | Gareth Davies | Date: | Mon, 08 Jan 2001 18:01:29 +0000 |
| Subject: | Silly Question Sorted | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-33421@lists.php.net to get a copy of this message | ||
Thanks for the one or two replies received folks. Found my answer and thought I'd post it in
case anyone else was interested:
echo "<input type=text name=myfield value=\"" . htmlspecialchars($value) .
"\">";
as this is a bit of a pain in the butt to remember for every single string fill in field, I created
a simple function:
function inputvalue ($t)
{
return "\"" . htmlspecialchars($t) . "\"";
}
which can no be accessed:
echo "<input type=text name=myfield value=" . inputvalue($value) . ">";
Any fields with this in will now be able to display both apostrophes and double quotes correctly
when editing a value already in the field.
Thanks again folks,
Gareth.