Re: Filtering out \ when a ' is user entered?
| From: | Philip Olson | Date: | Wed, 27 Jun 2001 15:48:21 +0000 |
| Subject: | Re: Filtering out \ when a ' is user entered? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-55417@lists.php.net to get a copy of this message | ||
Most likely the cause of this is the magic_quotes_gpc setting in your
(either maintained by you, or your hosts) php configurations, which are
contained within php.ini Information on this setting can be read about
here :
http://php.net/manual/configuration.php#ini.magic-quotes-gpc
In short, you can use the stripslashes() function to strip them :
http://www.php.net/manual/function.stripslashes.php
Essentially you'd do one of the following :
$data = stripslashes($data);
or
print stripslashes($data);
Regards,
Philip
On Tue, 26 Jun 2001, Marcus James Christian wrote:
> Hello,
>
> I'm pretty new to PHP but all I've seen of it so far I pretty much love!
>
> I've built a web log but when the user enters their data and they use '
> or " (and you know they will) php always shows it from the included
> web log as
>
> \' How can I filter out these backslashes so they don't appear on the
> final public viewable page?
>
> Thanks,
> Marcus
>
> --
> Marcus James Christian - UNLIMITED -
> Multimedia Internet Design
> http://mjchristianunlimited.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>