POST variables appear in PHP symbol table
<p>I discovered that my POST variables are being assigned as variables within my script.</p>

<p>This behavior doesn't seem right to me.  The elements of $_POST and $_GET are appearing in the symbol table as extracted variables without me explicitly doing setting them..  </p>

<p>The following example shows what I mean.  The script is called with </p>

<blockquote>
  <p><a href="http://localhost/test_script.php?select=1" rel="nofollow">http://localhost/test_script.php?select=1</a></p>
</blockquote>

<p>and the variable $select is already set and in the symbol table when the script executes.  Is there an explanation for this?  I thought I had to extract($_POST) or set the variable explicitly, e.g. $select = $_POST['select'];</p>

<p>Here is the script:</p>

<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;                     
&lt;?php 
echo "&lt;pre&gt;"; 
print_r(array_keys(get_defined_vars())); 
echo "&lt;/pre&gt;"; 
echo "\$select = $select";  
die; ?&gt;  
</code></pre>

<p>Here is the result:</p>

<pre><code>Array
(
    [0] =&gt; GLOBALS
    [1] =&gt; _ENV
...
    [31] =&gt; select
...
    [59] =&gt; argv
    [60] =&gt; argc
    [61] =&gt; _POST
    [62] =&gt; _GET
    [63] =&gt; _COOKIE
    [64] =&gt; _SERVER
    [65] =&gt; _FILES
    [66] =&gt; _REQUEST
)
$select = 1
</code></pre>

<p>PHP Version is 5.2.9-1</p>

<p><strong>ARGHH!  Just solved my own problem.</strong>  The register_globals directive was set "On" in php.ini.  I have disabled it, as it is supposed to be.  I'll just leave this here in case somebody else notices the same issue.  </p>

<p>Cheers
Jeff</p>
