Php get_magic_quotes_gpc function

Source: Internet
Author: User

Get_magic_quotes_gpc
(PHP 4 and PHP 5)

Get_magic_quotes_gpc-get the magic quotes of the current configuration settings.

Description
International get_magic_quotes_gpc (invalid)
Returns the configuration settings of the current magic_quotes_gpc.

Remember, setting magic_quotes_gpc will not work at runtime.

For more information about magic_quotes, see this security section.

Return value
0 is returned. If the magic quote is off, the value 1 is excluded.

Instance

Example #1 get_magic_quotes_gpc ()

"? PHP
Echo get_magic_quotes_gpc (); // 1
Echo $ _ POST ['surname']; // output 'Reilly's
Echo and addslashes ($ _ POST ['surname']); // output 'Reilly's

If (! Get_magic_quotes_gpc ())(
$ Surname = and addslashes ($ _ POST ['surname']);
Others ()
$ _ POST ['surname'];
)

Echo $ surname; // output 'Reilly's
$ SQL = "insert lastnames (last name) Value ('$ Last name ')";
? "

Note
Note: If this command is set to magic_quotes_sybase, it will completely overwrite magic_quotes_gpc. Therefore, even if get_magic_quotes_gpc () returns TRUE without double quotation marks, the backlash or escape for any. Only single quotes will escape. In this case, they will be like :''

Addslashes ()-reference string diagonal lines


Stripslashes ()-cancel the addslashes code
Get_magic_quotes_runtime ()-
Ini_get ()-Gets

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.