admin管理员组

文章数量:1417106

I'm using joomla and acesef as a plugin and I need to get the full querystring as is. The problem is when I use $_SERVER['QUERY_STRING'] it contains the joomla QS isntead of my custom parameters.

A javascript or PHP solution would do. thanks

Edit: Sample URL www.test/sc/my-account.html?action=payment-method I want to get

action=payment-method

Instead I get

option=_content&Itemid=4&id=16&lang=sc&view=article

I'm using joomla and acesef as a plugin and I need to get the full querystring as is. The problem is when I use $_SERVER['QUERY_STRING'] it contains the joomla QS isntead of my custom parameters.

A javascript or PHP solution would do. thanks

Edit: Sample URL www.test./sc/my-account.html?action=payment-method I want to get

action=payment-method

Instead I get

option=_content&Itemid=4&id=16&lang=sc&view=article
Share Improve this question edited Jun 30, 2012 at 16:15 Anirudh Ramanathan 46.8k23 gold badges135 silver badges194 bronze badges asked May 20, 2010 at 8:47 wnovenownoveno 5463 gold badges10 silver badges25 bronze badges 4
  • could you give an example of the url? – Sarfraz Commented May 20, 2010 at 8:49
  • 3 $_SERVER["QUERY_STRING"] is the best you're going to get. What kind of custom parameters are you talking about? Can you show an example? – Pekka Commented May 20, 2010 at 8:49
  • www.test./sc/my-account.html?action=payment-method but the server variable contains the joomla query string (_content...) – wnoveno Commented May 20, 2010 at 8:54
  • www.test./sc/my-account.html - yes – wnoveno Commented May 20, 2010 at 9:02
Add a ment  | 

3 Answers 3

Reset to default 1

Your Joomla setup probably has a mod_rewrite rule in .htaccess that is ignoring the original GET parameters and rewriting the whole GET query string, you'll have to hack your way into the .htaccess file.

Or stop using Joomla.

Found the one that solves my problem var qs = window.location.search.substring(1);

Thanks everyone SO rocks :)

You don't get what's in the URL, you get what the server hands you. That includes parameters added by things such as mod_rewrite. If you need specific parameters then index $_GET[] appropriately, otherwise live with it.

本文标签: phpHow can I get the full query string of a pageStack Overflow