QUERY_STRING vs REDIRECT_QUERY_STRING
Posted: Mon May 12, 2008 8:42 am
Hi
In my .htccess file I have
qs.php:
http://localhost/test/contact?a=23&b=45 gives
I was hoping $_SERVER['QUERY_STRING'] to contain a=23&b=45 only as $_SERVER['REDIRECT_QUERY_STRING'] would contain the generated one.
1. Whats the difference b/w QUERY_STRING & REDIRECT_QUERY_STRING
2. How do I get query string in the address URL as a=23&b=45 without dissecting REQUEST_URI ?
Im using PHP 5.2.6
Thanks
In my .htccess file I have
Code: Select all
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^contact$ qs.php?module=contact&%1Code: Select all
<pre>
<?php
print_r($_SERVER);
print_r($_GET)
?>Code: Select all
[REDIRECT_QUERY_STRING] => module=contact&a=23&b=45
[REDIRECT_URL] => /test/contact
[GATEWAY_INTERFACE] => CGI/1.1
[SERVER_PROTOCOL] => HTTP/1.1
[REQUEST_METHOD] => GET
[QUERY_STRING] => module=contact&a=23&b=45
[REQUEST_URI] => /test/contact?a=23&b=45
[SCRIPT_NAME] => /test/qs.php
[PHP_SELF] => /test/qs.php
1. Whats the difference b/w QUERY_STRING & REDIRECT_QUERY_STRING
2. How do I get query string in the address URL as a=23&b=45 without dissecting REQUEST_URI ?
Im using PHP 5.2.6
Thanks