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.
Link to comment
Share on other sites

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!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.