<?php
function translate($rus,$eng)
{
$lang = isset( $_GET['lang'] ) ? $_GET['lang'] : '';
$cookie_fresh = mktime(23,59,59,12,31,date('Y')+1);
switch( $lang ){
case 'ru':
setcookie('lang', 'ru', $cookie_fresh);
header("Location: ./");
exit();
break;
case 'ru':
setcookie('lang', 'eng', $cookie_fresh);
header("Location: ./");
exit();
break;
}
$c_lang = isset( $_COOKIE['lang'] ) ? $_COOKIE['lang'] : 'ru';
switch( $_COOKIE['lang'] ){
case 'eng':
echo $eng;
break;
case 'ru':
echo $rus;
break;
}
return true;
}
?>