Empty $_GET despite the URL
<p><code>$_GET</code> variable shows empty on the URL <code>www.abc.com/ec/basket.php?product_id=1</code>.</p>

<p>This is very surprising as <code>$_GET</code> does show value on a different domain with the same URL on the same server. Of course the code is a copy of the original domain.</p>

<p>I am baffled as to why is this happening. Even the first line of the code shows blank <code>$_GET</code>.</p>

<p>When I did <code>print_r($_SERVER)</code> on the first line of the page, I get the following response. The first two values are surprising.</p>

<pre><code>Array
(
    [REDIRECT_REDIRECT_REQUEST_METHOD] =&gt; GET
    [REDIRECT_REDIRECT_STATUS] =&gt; 404
    [REDIRECT_STATUS] =&gt; 404
    [HTTP_HOST] =&gt; www.abc.com
    [HTTP_CONNECTION] =&gt; keep-alive
    [HTTP_CACHE_CONTROL] =&gt; max-age=0
    [HTTP_USER_AGENT] =&gt; Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.27 (KHTML, like Gecko) Chrome/12.0.712.0 Safari/534.27
    [HTTP_ACCEPT] =&gt; text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    [HTTP_ACCEPT_ENCODING] =&gt; gzip,deflate,sdch
    [HTTP_ACCEPT_LANGUAGE] =&gt; en-GB,en-US;q=0.8,en;q=0.6
    [HTTP_ACCEPT_CHARSET] =&gt; ISO-8859-1,utf-8;q=0.7,*;q=0.3
    [HTTP_COOKIE] =&gt; [various values]
    [PATH] =&gt; /sbin:/usr/sbin:/bin:/usr/bin
    [SERVER_SIGNATURE] =&gt; Apache/2.2.3 (Red Hat) Server at www.abc.com Port 80


    [SERVER_SOFTWARE] =&gt; Apache/2.2.3 (Red Hat)
    [SERVER_NAME] =&gt; www.abc.com
    [SERVER_ADDR] =&gt; [IP address]
    [SERVER_PORT] =&gt; 80
    [REMOTE_ADDR] =&gt; [IP address]
    [DOCUMENT_ROOT] =&gt; /var/www/htdocs
    [SERVER_ADMIN] =&gt; webmaster@abc.com
    [SCRIPT_FILENAME] =&gt; /var/www/htdocs/index.php
    [REMOTE_PORT] =&gt; 39746
    [REDIRECT_URL] =&gt; /page-not-found.html
    [GATEWAY_INTERFACE] =&gt; CGI/1.1
    [SERVER_PROTOCOL] =&gt; HTTP/1.1
    [REQUEST_METHOD] =&gt; GET
    [QUERY_STRING] =&gt; 
    [REQUEST_URI] =&gt; /ec/basket.html?product_id=1
    [SCRIPT_NAME] =&gt; /index.php
    [PHP_SELF] =&gt; /index.php
    [PHP_AUTH_USER] =&gt; 
    [PHP_AUTH_PW] =&gt; 
    [REQUEST_TIME] =&gt; 1301662577
)
</code></pre>

<p>HTTP status on this shows 404 but the page comes up properly. Just that I am not able to get any values in the <code>$_GET</code> variable.</p>

<p>Also the <code>$_GET</code> variable works perfectly fine on other pages on the same site.</p>

<p>I have been scratching my head on this since hours but cannot find a solution. Any help will be highly appreciated.</p>
