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

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/en/security.magicquotes.what.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/security.magicquotes.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'security.magicquotes.what.php',
   
1 => 'What are Magic Quotes',
  ),
 
'up' =>
  array (
   
0 => 'security.magicquotes.php',
   
1 => 'Magic Quotes',
  ),
 
'prev' =>
  array (
   
0 => 'security.magicquotes.php',
   
1 => 'Magic Quotes',
  ),
 
'next' =>
  array (
   
0 => 'security.magicquotes.why.php',
   
1 => 'Why did we use Magic Quotes',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="security.magicquotes.what" class="sect1">
    <h2 class="title">What are Magic Quotes</h2>
    <p class="para">
     When on, all <i>&#039;</i> (single-quote), <i>&quot;</i>
     (double quote), <i>\</i> (backslash) and <i>NULL</i>
     characters are escaped with a backslash automatically.  This is identical
     to what <a href="function.addslashes.php" class="function">addslashes()</a> does.
    </p>
    <p class="para">
     There are three magic quote directives:
    </p>
    <ul class="itemizedlist">
     <li class="listitem">
      <span class="simpara">
       <a href="info.configuration.php#ini.magic-quotes-gpc" class="link">magic_quotes_gpc</a>
      </span>
      <span class="simpara">
       Affects HTTP Request data (GET, POST, and COOKIE). Cannot be set at
       runtime, and defaults to <em class="emphasis">on</em> in PHP.
      </span>
      <span class="simpara">
       See also <a href="function.get-magic-quotes-gpc.php" class="function">get_magic_quotes_gpc()</a>.
      </span>
     </li>
     <li class="listitem">
      <span class="simpara">
       <a href="info.configuration.php#ini.magic-quotes-runtime" class="link">magic_quotes_runtime</a>
      </span>
      <span class="simpara">
       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 <em class="emphasis">off</em>
       in PHP.
      </span>
      <span class="simpara">
       See also <a href="function.set-magic-quotes-runtime.php" class="function">set_magic_quotes_runtime()</a> and
       <a href="function.get-magic-quotes-runtime.php" class="function">get_magic_quotes_runtime()</a>.
      </span>
     </li>
     <li class="listitem">
      <span class="simpara">
       <a href="sybase.configuration.php#ini.magic-quotes-sybase" class="link">magic_quotes_sybase</a>
      </span>
      <span class="simpara">
       If enabled, a single-quote is escaped with a single-quote instead of a
       backslash.  If on, it completely overrides
       <a href="info.configuration.php#ini.magic-quotes-gpc" class="link">magic_quotes_gpc</a>. Having
       both directives enabled means only single quotes are escaped as
       <i>&#039;&#039;</i>. Double quotes, backslashes and NULL&#039;s will
       remain untouched and unescaped.
      </span>
      <span class="simpara">
       See also <a href="function.ini-get.php" class="function">ini_get()</a> for retrieving its value.
      </span>
     </li>
    </ul>
   </div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites