Re: Silly Question
| From: | Joe Stump | Date: | Mon, 08 Jan 2001 17:16:41 +0000 |
| Subject: | Re: Silly Question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-33262@lists.php.net to get a copy of this message | ||
I usually do value="<? echo addslashes($var); ?>"
--Joe
On Mon, Jan 08, 2001 at 05:09:19PM -0000, Gareth Davies wrote:
> Hi folks,
>
> It's been a really long day and my head's turned to mush on a simple issue. I'm
> creating an entry/edit form (i.e. input type=text) and want the user to be able to include both
> apostrophes (') and quotes (") in their entered text without a problem. Problem is when I
> try to place the entered value into the input field for editing using the apostrophe or quote -
> value='$from_db' (so as to allow the user the ability to use spaces in their entry).
> Whichever deliminator I use prohibits the use of that character for obvious reasons. I have tried
> using the wierd apostrophe to the left of the 1 key (`), but that doesn't work with Netscape
> unfortunately. I've also tried various string functions like addslashes/stripslashes,
> htmlspecialchars, etc. but none of them are giving me what I want.
>
> I'm sure there's a really simple answer to this, but can't think what it is.
>
> Thanks in anticipation, guys.
>
> Gareth Davies
> Progressive Business Services Ltd
>
> +44 (0) 1274 889592 Office
> +44 (0) 1274 889656 Fax
> +44 (0) 7970 733851 Mobile (24 Hour)
---
Joe Stump
PHP Programmer
www.Care2.com