downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Why did we use Magic Quotes> <Magic Quotes
[edit] Last updated: Sat, 07 Jan 2012

view this page in

What are Magic Quotes

Warnung

Dieses Feature ist seit PHP 5.3.0 DEPRECATED (veraltet). Sich auf dieses Feature zu verlassen ist in keiner Weise empfehlenswert.

When on, all ' (single-quote), " (double quote), \ (backslash) and NULL characters are escaped with a backslash automatically. This is identical to what addslashes() does.

There are three magic quote directives:

  • magic_quotes_gpc Affects HTTP Request data (GET, POST, and COOKIE). Cannot be set at runtime, and defaults to on in PHP. See also get_magic_quotes_gpc().
  • magic_quotes_runtime If enabled, most functions that return data from an external source, including databases and text files, will have quotes escaped with a backslash. Can be set at runtime, and defaults to off in PHP. See also set_magic_quotes_runtime() and get_magic_quotes_runtime().
  • magic_quotes_sybase If enabled, a single-quote is escaped with a single-quote instead of a backslash. If on, it completely overrides magic_quotes_gpc. Having both directives enabled means only single quotes are escaped as ''. Double quotes, backslashes and NULL's will remain untouched and unescaped. See also ini_get() for retrieving its value.


add a note add a note User Contributed Notes What are Magic Quotes
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites