开发者

How can I get the full query string of a page

开发者 https://www.devze.com 2022-12-31 22:27 出处:网络
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 custo

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.com/sc/my-account.html?action=payment-method I want to get

action=payment-method

Instead I get

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号