Return to Snippet

Revision: 35641
at November 11, 2010 08:15 by nveselinov


Updated Code
<!-- Included files contain, variable with their values -->
<!-- Example url: index.php?lang=en -->
<?php
if (!isset ($_GET['lang'])) {
	if(isset($_SESSION['lang'])){
		$lang=$_SESSION['lang'];
	}
	else {
	$lang='bg';
	}
} else {
	$lang = $_GET['lang'];
}
if ($lang=='bg') {
	$_SESSION['lang'] = 'bg';
	require('bg.php');
} else {
	$_SESSION['lang'] = 'en';
	require('en.php');
}
$_SESSION['lang']=$lang;

echo "$home";
?>

Revision: 35640
at November 11, 2010 08:12 by nveselinov


Initial Code
<!-- Included files contain, variable with their values -->
<?php
if (!isset ($_GET['lang'])) {
	if(isset($_SESSION['lang'])){
		$lang=$_SESSION['lang'];
	}
	else {
	$lang='bg';
	}
} else {
	$lang = $_GET['lang'];
}
if ($lang=='bg') {
	$_SESSION['lang'] = 'bg';
	require('bg.php');
} else {
	$_SESSION['lang'] = 'en';
	require('en.php');
}
$_SESSION['lang']=$lang;

echo "$home";
?>

Initial URL

                                

Initial Description

                                

Initial Title
Multilanguage site with php

Initial Tags
php

Initial Language
PHP