<?php

require_once 'incfiles/core.php';
require_once 'incfiles/func.php';
require_once 'incfiles/auth.php';
require_once 'incfiles/user.php';

if (!empty($user_id))
{
	if ($_GET['l'] == 'ru') mysql_query("UPDATE `users` SET `lang` = 'ru' WHERE `id` = '".$user_id."'");
	else if ($_GET['l'] == 'ua') mysql_query("UPDATE `users` SET `lang` = 'ua' WHERE `id` = '".$user_id."'");
}
else
{
	if ($_GET['l'] == 'ru')	setcookie('lang', 'ru', time()+86400*365, '/');
	else if ($_GET['l'] == 'ua') setcookie('lang', 'ua', time()+86400*365, '/');
}
	go($_SERVER['HTTP_REFERER']);


?>