Location: PHPKode > scripts > Simple Language Changer Script > index.php
<?php
/*
Description: 	Simple Language Changer Class 
				you can use it for change language to another one 
				it is simple to use 
Auther:			Payam khaninajad 
Contact Email:	hide@address.com
Site:			http://progvig.ir
Year:			2010/11/13
*/
session_start();
// register session to change language
session_register("mylang");
// if session isn't set 
if(!isset($_SESSION['mylang'])) 
{
	$_SESSION['mylang']="en";
}
//include language class
require_once 'inc/lang.class.php';
$mylang=new mylanguage();
$mylang->load_language($_SESSION['mylang']);
// echo simple title
echo PROGVIGADS_Welcome."<br/>";
echo PROGVIGADS_my_location.PROGVIGADS_location."<br/>";
echo PROGVIGADS_Class_version.PROGVIGADS_Version;
///////or you can do it with site setting or user profile load it with mysql and change site language
// like $mylang->load_language("fa");
// or another way 


if(isset($_GET['lang'])) 
{
	switch($_GET['lang']) 
	{
		case "ir":
		$_SESSION['mylang']="fa";
		break;
		case "en":
		$_SESSION['mylang']="en";
		break;
		case "tr":
		$_SESSION['mylang']="tr";
		break;
	}
}

?>
<br />
<br />

<a href="index.php?lang=en"><img src="images/us.gif" /></a> | <a href="index.php?lang=ir"><img src="images/ir.gif" /> </a>|<a href="index.php?lang=tr"> <img src="images/tr.gif" /></a><br />
<a href="http://progvig.ir">Progvig.ir</a>
Return current item: Simple Language Changer Script