Sveiki, pasidariau kalbų pasirinkimo sistemėlę, ir ant xampp viskas veikia be problemų... Bet perkėlus ant hostingo:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/index/domains/index/public_html/index.php:9) in /home/index/domains/index/public_html/lang/common.php on line 2
Warning: Cannot modify header information - headers already sent by (output started at /home/index/domains/index/public_html/index.php:9) in /home/index/domains/index/public_html/lang/common.php on line 3
Warning: Cannot modify header information - headers already sent by (output started at /home/index/domains/index/public_html/index.php:9) in /home/index/domains/index/public_html/lang/common.php on line 11
Nežinau, kodėl šitą errorą rodo, bandžiau dar chmodinti failus bet...
Common.php
<?php
session_start();
header('Cache-control: private');
if(isSet($_GET['lang']))
{
$lang = $_GET['lang'];
$_SESSION['lang'] = $lang;
setcookie('lang', $lang, time() + (3600 * 24 * 30));
}
else if(isSet($_SESSION['lang']))
{
$lang = $_SESSION['lang'];
}
else if(isSet($_COOKIE['lang']))
{
$lang = $_COOKIE['lang'];
}
else
{
$lang = 'en';
}
switch ($lang) {
case 'en':
$lang_file = 'lang.en.php';
break;
case 'lt':
$lang_file = 'lang.lt.php';
break;
default:
$lang_file = 'lang.lt.php';
}
include_once 'lang/'.$lang_file;
?>
index.php pradžia
<meta http-equiv="Content-Type" content="text/html; charset=windows-1257">
<meta name="Author" content="" />
<meta name="keywords" content="" />
<link rel="stylesheet" type="text/css" href="styles.css"/>
<div id="heading"><h2><div id="ltext">Index</div></h2></div>
<div id="lang">
<ul><?php
require ("lang/common.php");
?>
<br>
<a href="?lang=en"><img src="lang/flags/en.gif"></a>
<a href="?lang=lt"><img src="lang/flags/lt.gif"></a>