paperweight Posted November 25, 2014 Share Posted November 25, 2014 This is a Smarty question for WHMCS, but I could not find the good answer on Smarty's website. I want to manually create Language Selection buttons on my WHMCS template. My current code looks like this: <a href="$_SERVER[REQUEST_URI]?language=french"><img src="templates/{$template}/img/flag-fr.png"></a> | <img src="templates/{$template}/img/flag-uk.png"> The code above works great if the WHMCS URL that the user is on does not have any ?something=anything attached to it. For example, if the URL is this: http://domain.com/whmcs/clientarea.php Then the code above will correctly display the link here: http://domain.com/whmcs/clientarea.php?language=french But if the WHMCS URL is this: http://domain.com/whmcs/clientarea.php?action=details then the code above will show a bad URL because it uses 2 "?" like this: http://domain.com/whmcs/clientarea.php?action=details?language=french So I am trying to figure a way to change the 2nd "?" to "&" so the URL looks correct like this: http://domain.com/whmcs/clientarea.php?action=details&language=french Any ideas or methods for doing that? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 25, 2014 Share Posted November 25, 2014 logically, the easiest way would be to first check if $_SERVER[REQUEST_URI] contains a '?' - if it doesn't, then you can use ?language= ... if it does, then you use &language= 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.