mpempas Posted August 7, 2009 Share Posted August 7, 2009 I need an expert help, i have a drop-down select box and i would like to change language from here. The code is working but the problem is: 1. When im changing language english is still the first in the drop-down box and i cant change back to english, so when change a language the defualt one would be the one im using. 2. If there is any way do not change website to ?locale=en/el just refresh and active this language. Im using $_SESSION['langSYS'] <form name='language_switcher' method='post'> <select name="language" id="language" onChange="location.href('?locale='+this.value)"> <option value="en">English</option> <option value="el">Ελληνικά</option> </select></form> thank you Link to comment https://forums.phpfreaks.com/topic/169266-solved-drop-down-box-language-change/ Share on other sites More sharing options...
The Little Guy Posted August 7, 2009 Share Posted August 7, 2009 The problem is, is that you are not using selected="selected" <form name='language_switcher' method='post'> <select name="language" id="language" onChange="location.href('?locale='+this.value)"> <option value="en"<?php echo ($_SESSION['langSYS'] == 'en')?' selected="selected"':'';?>>English</option> <option value="el"<?php echo ($_SESSION['langSYS'] == 'el')?' selected="selected"':'';?>>Ελληνικά</option> </select> </form> Link to comment https://forums.phpfreaks.com/topic/169266-solved-drop-down-box-language-change/#findComment-893221 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.