cohq82 Posted April 22, 2008 Share Posted April 22, 2008 Hi all, I have this question and I may use the wrong language. So i am sorry about that. Basically, I have this website which I am building a mod to show in English and AnotherLanguage. There will be a button to change the language. When visitors click the button, it will refresh the page and change the language. The implementation method I tried to follow was: create that new button and add a parameter in the link such as lang=en or lang=other. However, the page could have many other parameters. The questions are: 1. How to get all the parameters in the current page? 2. If exist lang=xxx, how to get the value and remove it from the current page? The purpose is to add <A href="www.website.com/index.php?para1=xxx¶2=yyy&lang=en">Language Button</A> in the new page as the hack! Please let me know how to do this. Otherwise, I am open to other alternatives. Thanks again!! Link to comment https://forums.phpfreaks.com/topic/102252-get-current-parameters-in-link/ Share on other sites More sharing options...
DarkWater Posted April 22, 2008 Share Posted April 22, 2008 $param = $_GET['param_name']; So if you had <a href="www.website.com/index.php?lang=gr>Change Language (Greek)</a> $_GET['lang'] would be set to "gr", and then you could analyze that in your script. Link to comment https://forums.phpfreaks.com/topic/102252-get-current-parameters-in-link/#findComment-523550 Share on other sites More sharing options...
cohq82 Posted April 25, 2008 Author Share Posted April 25, 2008 Thanks Link to comment https://forums.phpfreaks.com/topic/102252-get-current-parameters-in-link/#findComment-527449 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.