Jump to content

The meaning of get_magic_quotes_gpc()


lucerias

Recommended Posts

In short:
Returns the current configuration setting of magic_quotes_gpc which is set in the php.ini

So if the magic_quotes_gpc is set to 1 or TRUE the get_magic_quotes_gpc function will return true. If magic_quotes_gpc is set to 0 or FALSE get_magic_quotes_gpc function will return false.

magic_quotes escapes quotes from within a string which is PHPs way of making user input safe for you to use.
It was a safety feature, originally designed to help new coders starting to learn PHP. Because PHP learning curve is some what easy compared to Perl or other higher level languages you end up with many people who want just the end result, they don't care about learning how to set a good coding standard that they should follow. This results in thousands of hacked script floating around the Internet that are dangerous. So my hosts started implementing magic_quotes so as to protect their servers from all of these dangerous scripts! But this can cause even more problems, if you don't check if magic_quotes is on and then you addslashes to already escaped string. Adding slashes like anything else you do, should be done in a selective way, because it senseless to addslashes to a variable value that doesn't need it.

me!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.