transparencia Posted October 9, 2010 Share Posted October 9, 2010 Hello guys, I have a select form that changes the website countries. My website is built like this: fr.website.com, de.website.com, etc... When the user changes the country in the form, I would like to send him to one of the subdomains. I have this code: Code: <select onchange="window.location=+this.value'.website.com'"> <option value="at">Austria</option> <option value="be">Belgium</option> etc... If the user press Austria I want to send him to at.website.com. How can I do that? Link to comment https://forums.phpfreaks.com/topic/215515-select-onchange-change-to-another-subdomain/ Share on other sites More sharing options...
Alex Posted October 9, 2010 Share Posted October 9, 2010 <select onchange="window.location='http://'+this.value+'.website.com';"> <option value="at">Austria</option> <option value="be">Belgium</option> </select> Link to comment https://forums.phpfreaks.com/topic/215515-select-onchange-change-to-another-subdomain/#findComment-1120651 Share on other sites More sharing options...
transparencia Posted October 9, 2010 Author Share Posted October 9, 2010 Perfect! Thank you very much, Alex. Link to comment https://forums.phpfreaks.com/topic/215515-select-onchange-change-to-another-subdomain/#findComment-1120655 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.