RE: [PHP] Still need help with ereg
| From: | Jack Dempsey | Date: | Fri, 18 Apr 2003 02:44:58 +0000 |
| Subject: | RE: [PHP] Still need help with ereg | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-144362@lists.php.net to get a copy of this message | ||
magic quotes lets php escape your quotes for you.
take the usual circumstance of a user submitting data to a php script, and
that script entering it into a database.
if the user has quotes in the data, it could create an error in the SQL
command...so, magic quotes automatically escapes these
quotes or apostrophes for you on submitting the data to a page...
so, you submit a form with this text:
it's not over till it's over
if you have magic_quotes on, without doing anything, php will escape the
quotes, so your data will be:
it\'s not over till it\'s over
this is nice when you're usually going to be taking data and throwing it
into a database, but if you're not expecting it, it could
catch you unaware...
hope this helps,
jack
> -----Original Message-----
> From: C.R. [mailto:odcs@rogers.com]
> Sent: Thursday, April 17, 2003 7:06 PM
> To: PHP Windows; PHP General
> Subject: [PHP] Still need help with ereg
>
>
> I am trying to create a validation script using ereg and I'm having some
> problems. I think part of this is due to not quite understanding what the
> purpose of magic quotes is - actually this whole idea things
> being escaped
> with slashes confuses me. Could someone explain in plain english what all
> this means. Also, what is the satandard - should get_magic_quotes
> be set on
> or off in the php.ini and what are the advantages or disadvantages.
>
> Thanks
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>