scar5308 Posted October 23, 2006 Share Posted October 23, 2006 I am trying to set up a multi lingual web site.Currently, the following works well as a static menu but I would like to change it to a dropdown menu using if possible, the 'select onchange=' method so the user doesn't have to click on a OK or Select button.I would also like a message to appear in the drop down in its default state such as 'Select Language'I have a version at: [url=http://www.webwhiz.co.uk/lang5/langselect.php]http://www.webwhiz.co.uk/lang5/langselect.php[/url] which doesn't work either.I asked on the forum for help but nothing so far! (see Help with arrays please: [url=http://www.phpfreaks.com/forums/index.php/topic,112413.0.html]http://www.phpfreaks.com/forums/index.php/topic,112413.0.html[/url] ) I have tried to sort this out but am not really a coder. The code I have so far is:[code]<? include_once ("./setstring.inc") ?><?= "<a href='" . $PHP_SELF . "?lang=pt-br'>Portuguese</a>" ?> |<?= "<a href='" . $PHP_SELF . "?lang=fr'>Français</a>" ?> |<?= "<a href='" . $PHP_SELF . "?lang=en'>English</a>" ?> |<?= "<a href='" . $PHP_SELF . "?logoff=1'>Logoff</a>" ?><? include ( setstring ( 'pt-br', './portuguese.php', 'fr', './french.php', 'en', './english.php') )?>[/code]I wouldn't mind getting either to work properly, both would be a bonus! A virtual beer is on offer for anyone who can help! Link to comment https://forums.phpfreaks.com/topic/24858-menu-problem-using-php_self/ Share on other sites More sharing options...
Caesar Posted October 23, 2006 Share Posted October 23, 2006 Not sure I would go about it this way but, using the variable your passing via url, I suppose one easy approach would be:[code]<?php if($_GET[lang] == 'pt') {include'portuguese.php';} elseif($_GET[lang] == 'sp') {include'spanish.php';} elseif($_GET[lang] == 'fr') {include'french.php';} else{include'english.php';}?>[/code] Link to comment https://forums.phpfreaks.com/topic/24858-menu-problem-using-php_self/#findComment-113299 Share on other sites More sharing options...
scar5308 Posted October 23, 2006 Author Share Posted October 23, 2006 Thanks for that but I am already using something similar for the initial page.What I wanted to do was; once the visitor has been directed to the page according to the $_GET[lang] I wanted to give them the option of selecting a different language. All the pages are just templates and the script calls up the various includes etc. according to the language detected from language specific include folders. I then wanted a drop down menu on the main page that would change the language include directory. I would therefore only have one set of pages with just the includes and perhaps some images changing according to the language either selected or detected.Hope that's clear :-) Link to comment https://forums.phpfreaks.com/topic/24858-menu-problem-using-php_self/#findComment-113331 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.