PHP: Disabling Magic Quotes - Manual in Deutsh
PHP: Disabling Magic Quotes - Manual in French
PHP: Disabling Magic Quotes - Manual in Polish

You Are At PHP: Disabling Magic Quotes - 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
PrevChapter 31. Magic QuotesNext

Disabling Magic Quotes

The magic_quotes_gpc directive may only be disabled at the system level, and not at runtime. In otherwords, use of ini_set() is not an option.

Example 31-1. Disabling magic quotes server side

An example that sets the value of these directives to Off in php.ini. For additional details, read the manual section titled How to change configuration settings.

; Magic quotes
;

; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = Off

; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
magic_quotes_runtime = Off

; Use Sybase-style magic quotes (escape ' with '' instead of \').
magic_quotes_sybase = Off

If access to the server configuration is unavailable, use of .htaccess is also an option. For example:

php_flag magic_quotes_gpc Off

In the interest of writing portable code (code that works in any environment), like if setting at the server level is not possible, here's an example to disable magic_quotes_gpc at runtime. This method is inefficient so it's preferred to instead set the appropriate directives elsewhere.

Example 31-2. Disabling magic quotes at runtime

<?php
if (get_magic_quotes_gpc()) {
    function
stripslashes_deep($value)
    {
        
$value = is_array($value) ?
                    
array_map('stripslashes_deep', $value) :
                    
stripslashes($value);

        return
$value;
    }

    
$_POST = array_map('stripslashes_deep', $_POST);
    
$_GET = array_map('stripslashes_deep', $_GET);
    
$_COOKIE = array_map('stripslashes_deep', $_COOKIE);
    
$_REQUEST = array_map('stripslashes_deep', $_REQUEST);
}
?>

Widowiskowa i skuteczna reklama zewnętrzna dla twojego biznesu
sale sale szkoleniowe szkolenia
skarbykibica
meble łazienkowe
Pomoc drogowa Rzeszów merc

Another Useful functions:


zend-api.zend-check-magic-method-implementation | security.magicquotes.whynot | security.magicquotes.why | security.magicquotes | security.magicquotes.disabling | ref.mime-magic | ref.imagick | language.oop5.magic | language.oop.magic-functions | function.set-magic-quotes-runtime | function.imagick-zoom | function.imagick-writeimages | function.imagick-writeimage | function.imagick-wave | function.imagick-unsharpmask | function.imagick-transparent | function.imagick-transformrgb | function.imagick-threshold | function.imagick-swirl | function.imagick-spread | function.imagick-solarize | function.imagick-shear | function.imagick-sharpen | function.imagick-shade | function.imagick-setfontstyle | function.imagick-setfontsize | function.imagick-setfontface | function.imagick-setfillopacity | function.imagick-setfillcolor | function.imagick-setdpi | function.imagick-setcompressiontype | function.imagick-setcompressionquality | function.imagick-set-image-quality | function.imagick-set-image-comment | function.imagick-scale | function.imagick-sample | function.imagick-rotate | function.imagick-roll | function.imagick-resize | function.imagick-reducenoise | function.imagick-readimage | function.imagick-read | function.imagick-raise | function.imagick-pushlist | function.imagick-profile | function.imagick-prev | function.imagick-poplist | function.imagick-ordereddither | function.imagick-oilpaint | function.imagick-normalize | function.imagick-next | function.imagick-newimagelist | function.imagick-negate | function.imagick-motionblur | function.imagick-mosaic | function.imagick-modulate | function.imagick-minify | function.imagick-medianfilter | function.imagick-magnify | function.imagick-level | function.imagick-ispaletteimage | function.imagick-isopaqueimage | function.imagick-ismonochromeimage | function.imagick-isimagesequal | function.imagick-isgrayimage | function.imagick-iserror | function.imagick-implode | function.imagick-image2blob | function.imagick-goto | function.imagick-getwidth | function.imagick-getnumbercolors | function.imagick-getmimetype | function.imagick-getmagick | function.imagick-getlistsize | function.imagick-getlistindex | function.imagick-getimagetype | function.imagick-getimagefromlist | function.imagick-getimagedepth | function.imagick-getheight | function.imagick-getdpiy | function.imagick-getdpix | function.imagick-getcolorspace | function.imagick-getcanvas | function.imagick-gaussianblur | function.imagick-gamma | function.imagick-free | function.imagick-frame | function.imagick-flop | function.imagick-flip | function.imagick-flatten | function.imagick-first | function.imagick-failedreason | function.imagick-faileddescription | function.imagick-error | function.imagick-equalize | function.imagick-enhance | function.imagick-emboss | function.imagick-edge | function.imagick-drawrectangle | function.imagick-drawpoint | function.imagick-drawline | function.imagick-drawellipse | function.imagick-drawcircle | function.imagick-drawarc | function.imagick-drawannotation | function.imagick-destroyhandle | function.imagick-despeckle | function.imagick-crop | function.imagick-convert | function.imagick-contrast | function.imagick-composite | function.imagick-clonehandle | function.imagick-chop | function.imagick-charcoal | function.imagick-border | function.imagick-blur | function.imagick-blob2image | function.imagick-begindraw | function.get-magic-quotes-runtime | function.get-magic-quotes-gpc |


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.