PHP: get_magic_quotes_gpc - Manual in Deutsh
PHP: get_magic_quotes_gpc - Manual in French
PHP: get_magic_quotes_gpc - Manual in Polish

You Are At PHP: get_magic_quotes_gpc - Manual Area


recent searches:
include functions , variable functions , post functions...




If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.

PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.

PHP Manual
PrevNext

get_magic_quotes_gpc

(PHP 3 >= 3.0.6, PHP 4, PHP 5)

get_magic_quotes_gpc -- Gets the current configuration setting of magic quotes gpc

Description

int get_magic_quotes_gpc ( void )

Returns the current configuration setting of magic_quotes_gpc

Keep in mind that the setting magic_quotes_gpc will not work at runtime.

For more information about magic_quotes, see this security section.

Return Values

Returns 0 if magic quotes gpc are off, 1 otherwise.

Examples

Example 1. get_magic_quotes_gpc() example

<?php
echo get_magic_quotes_gpc();         // 1
echo $_POST['lastname'];             // O\'reilly
echo addslashes($_POST['lastname']); // O\\\'reilly

if (!get_magic_quotes_gpc()) {
    
$lastname = addslashes($_POST['lastname']);
} else {
    
$lastname = $_POST['lastname'];
}

echo
$lastname; // O\'reilly
$sql = "INSERT INTO lastnames (lastname) VALUES ('$lastname')";
?>

Notes

Note: If the directive magic_quotes_sybase is ON it will completely override magic_quotes_gpc. So even when get_magic_quotes_gpc() returns TRUE neither double quotes, backslashes or NUL's will be escaped. Only single quotes will be escaped. In this case they'll look like: ''

See Also

addslashes()
stripslashes()
get_magic_quotes_runtime()
ini_get()

najlepsza strona darmo gra profesjonalne wyniki
fizjoterapia
fotograf lublin
Najsmaczniejsze obiady łodź
całodobowa pomoc drogowa Rzeszów

Another Useful functions:


zend-macro.zend-get-module | zend-api.zend-get-module-version | zend-api.zend-get-module-started | function.stream-get-meta-data | function.pdf-get-minorversion | function.pdf-get-majorversion | function.newt-checkbox-tree-get-multi-selection | function.mysqli-get-metadata | function.mcrypt-enc-get-modes-name | function.maxdb-get-metadata | function.get-meta-tags | function.get-magic-quotes-runtime | function.get-magic-quotes-gpc | function.dns-get-mx | function.apache-get-modules |


PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.