$_SERVER['QUERY_STRING'] returns blank

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
PHPForever
Forum Newbie
Posts: 14
Joined: Sun Aug 31, 2008 11:31 am

$_SERVER['QUERY_STRING'] returns blank

Post by PHPForever »

ok guys, this is a problem thats been bothering us for a while.

Basically, we have a domain called http://www.testparentgiving.com and shop.parentgiving.com

Now, if I do a http://www.testparentgiving.com/index.p ... goryID=169, things work well and I see the ctegory page.

However if I do a shop.parentgiving.com/index.php?categoryID=169, it shows up the default index page again and not the category page.

Note: Both the sites are identical.

The difference i do see though when I try to print the $_SERVER['QUERY_STRING'] on the index.php under http://www.testparentgiving.com domain, it shows up categoryID=169

however this is blank under the shop.parentgiving.com domain .

Thoughts Anyone ?

Appreciate the help.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: $_SERVER['QUERY_STRING'] returns blank

Post by Benjamin »

Why aren't you using the $_GET variable? You can rebuild the query string yourself:

Code: Select all

 
# php 5 only
$queryString = http_build_query($_GET);
 
Post Reply