Shile
16 Oct 2008, 10:34 AM
I am making multilingual site with this script
<?php
// get informations from url
$lang = @$_GET['lang']; // @ supress errors if is lang definition empty
$page = @$_GET['page']; // @ supress errors if is page definiton empty
if($lang == "ger"){ // include ger container and right page
include("container_ger.php");
switch($page) {
case "1": include("1ger.php"); break;
case "2": include("2ger.php"); break;
case "3": include("3ger.php"); break;
default: include("1ger.php");
}
} else {
include("container_eng.php"); // include eng container and right page
switch($page) {
case "1": include("1eng.php"); break;
case "2": include("2eng.php"); break;
case "3": include("3eng.php"); break;
default: include("1eng.php");
}
}
?>
And I make link with this
<?php
echo "<a href = www.yoursite.com/index.php?lang=ger&page=$page> Germany </a>" ;
?>
or for same language and different page:
PHP Code:
<?php
echo "<a href = www.yoursite.com/index.php?lang=$lang&page=3> Go to page 3</a>" ;
?>
BUT!! The link are generated by ECHO command...I know how to make it an image and text but now I want to make drop drop down menu and I dont know how to make it.How to include echo function in drop down menu??
If you know how or you have different script for changing pages please post..
tnx
<?php
// get informations from url
$lang = @$_GET['lang']; // @ supress errors if is lang definition empty
$page = @$_GET['page']; // @ supress errors if is page definiton empty
if($lang == "ger"){ // include ger container and right page
include("container_ger.php");
switch($page) {
case "1": include("1ger.php"); break;
case "2": include("2ger.php"); break;
case "3": include("3ger.php"); break;
default: include("1ger.php");
}
} else {
include("container_eng.php"); // include eng container and right page
switch($page) {
case "1": include("1eng.php"); break;
case "2": include("2eng.php"); break;
case "3": include("3eng.php"); break;
default: include("1eng.php");
}
}
?>
And I make link with this
<?php
echo "<a href = www.yoursite.com/index.php?lang=ger&page=$page> Germany </a>" ;
?>
or for same language and different page:
PHP Code:
<?php
echo "<a href = www.yoursite.com/index.php?lang=$lang&page=3> Go to page 3</a>" ;
?>
BUT!! The link are generated by ECHO command...I know how to make it an image and text but now I want to make drop drop down menu and I dont know how to make it.How to include echo function in drop down menu??
If you know how or you have different script for changing pages please post..
tnx