Re: Silly Question
| From: | Joe Stump | Date: | Mon, 08 Jan 2001 18:14:50 +0000 |
| Subject: | Re: Silly Question | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-33272@lists.php.net to get a copy of this message | ||
I know - adding a slash before your middle apostrophe will eliminate that.
--Joe
On Mon, Jan 08, 2001 at 05:48:59PM -0000, Gareth Davies wrote:
> My overly long text is a bit confusing, sorry. I'm okay with displaying the
> value on the screen, it's getting it back into the input field as it should
> be that's the problem.
>
> e.g.
>
> <input type=text value='$var'>
>
> will fail if $var contains any apostrophes.
>
>
> ----- Original Message -----
> From: Joe Stump <joe@earth.care2.com>
> To: Gareth Davies <garethdavies@frogtrade.com>
> Cc: <php-general@lists.php.net>
> Sent: Monday, January 08, 2001 5:16 PM
> Subject: Re: [PHP] Silly Question
>
>
> > 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
> >
> >
>
---
Joe Stump
PHP Programmer
www.Care2.com