Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How will you create a bi-lingual site (multiple languages) ?

Answer Posted / ahmad pujianto

use session...it work better. Check my sample
<?php
session_start();
session_register("language");

if(empty($_SESSION['language']))
{
$_SESSION['language']='en';
}

if(isset($_GET[lang])){
if($_GET[lang]=='id' or $_GET[lang]=='en'){
$_SESSION['language']=$_GET[lang];

echo '<meta http-equiv="refresh" content="0;
url=?language='.$_GET[lang].'">';
}else{
echo '<meta http-equiv="refresh" content="0;
url=?error=Unavailable_Language_Option">';
}
}

?>
Make this script on a single file, include the file in each
pages, then simply add link that give value $_GET[lang].
Each time there is $_GET[lang], this script will change the
$_session['language'].

Then in each part that need to be bilingual, check for
$_SESSION['language'].

Thats all

Is This Answer Correct ?    14 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is php better than python?

911


What type of headers have to be added in the mail function to attach a file?

891


Can I learn php in a month?

995


What is the use of hooks?

902


What is a controller in php?

951


Can we use get instead of post?

908


When to use get and post request?

956


What is api used for?

872


Tell me what is htaccess?

862


Does php need html?

919


What is if isset ($_ post submit )) in php?

967


How can we get ip address of a client in php?

918


What is difference between print and echo in php?

871


What is a php tag?

835


Explain about the $_GET variable of PHP?

952