Re: quotes in text.

From: Date: Fri, 16 Jul 2004 16:58:55 +0000
Subject: Re: quotes in text.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-190732@lists.php.net to get a copy of this message
On Fri, 16 Jul 2004, John W. Holmes wrote: > Let's say you have $_POST['text'] from the user. > > To display the value back to the user with magic_quotes_enabled, you'd > do this: > > echo htmlentities(stripslashes($_POST['text'])); > > To put the value into a hidden form element, you'd do this: > > <input type="hidden" name="text" > value="<?=htmlentities(stripslashes($_POST['text']))?>"> > > Now, $_POST['text'] will come out correctly on Page 3. Since you seem to > have magic_quotes_gpc enabled, you can put the value directly into your > query. Actually when I tried the above example nothing was entered into the database. This worked.. htmlentities($_POST['text']). Thanks, Ed

« previous php.general (#190732) next »