In fondo alla pagina del sito mi esce questo messaggio
PHP Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\WebSites\download.risorsefree.net_3duiitmudtpkq e7o\ciruito-linck-banner.php:95) in C:\WebSites\download.risorsefree.net_3duiitmudtpkq e7o\YKomment\commenti.php on line 53
Qualcuno mi aiuta? allego frammento del codice
Codice PHP:
<?php
$folder = "YKomment/";
###########################################################
####
#### NON CAMBIARE DA QUI IN POI
####
###########################################################
if (isset($_GET['mode']) && $_GET['mode']=='view'){$folder = "";}
include ($folder."config.php");
$ora = date("H:i");
setlocale (LC_TIME, "it_IT");
$giorno = strftime ("%d %B %G");
$stile = $s;
if (isset($_GET['mode']) && $_GET['mode']=='view'){
$f = $_GET['f'];
$stile = $_GET['s'];
$vv = 0;
}
$file = $folder."commenti/".$f.".txt";
if (isset($_POST['nome'])){
$nome = $_POST['nome'];
$email = $_POST['email'];
$web = $_POST['web'];
$msg = stripslashes($_POST['messaggio']);
$msg = htmlspecialchars ($msg, ENT_QUOTES);
$messaggio = str_replace("\n", "<br>", $msg);
}
// SCRITTURA
# CAPTCHA
session_start();
function audit() {
$digit = $_SESSION['digit'];
$userdigit = $_POST['userdigit'];
if (($digit == $userdigit) && ($digit > 1)) {
return true;
} else {
return false;
}
}
if($nome!=null){
if (!audit()){echo "<script> alert('Forse hai sbagliato a scrivere il codice nella figura...riprova!');</script>";}
else {
$open = fopen ($file, "a+");
fwrite ($open,$nome."|".$email."|".$web."|".$messaggio."|".time()."|\n");
fclose ($open);
}
}
//VISUALIZZA MESSAGGI
echo '<div align="left" style="position:relative; background-color:'.$bgf.'; font:'.$fcar.'; font-weight:bold; font-color:'.$fcol.'; margin:1px auto; width:'.$ltab.'; padding:15px;">
<p align="center">...commenti...';
fopen ($file, "a+");
$msgg = file($file);
$vv = count($msgg)-$v;
if (isset($_GET['mode']) && $_GET['mode']=='view'){
$f = $_GET['f'];
$stile = $_GET['s'];
$vv = 0;
}
if (count($msgg)-$v<0){$vv=0;}
for ($i=count($msgg)-1; $i>=$vv; $i--){
$p=explode("|",$msgg[$i]);
$nome=$p['0'];
$web = $p['2'];
if ($p['1'] != null && $vemail==1){$email = " - ".$p['1'];} else {$email = "";}
if ($p['2'] != null){$t = " - ";} else {$t="";}
$messaggio=$p['3'];
if(strlen($p[4])==10) {
setlocale (LC_TIME, "it_IT");
$ora = date("H:i",$p[4]);
$giorno = strftime ("%d %B %G",$p[4]);
$data = $giorno.' - '.$ora;
}
else $data = $p[4];
$smile=glob($folder.'smiles/*.*');
foreach ($smile as $smile){
$n=basename($smile, '.gif');
$a= ":$n:";
$messaggio = str_replace($a, '<img src="'.$folder.'smiles/'.$n.'.gif" border=0></a>', $messaggio);
}
echo '<div style="margin-top:10px; border:1px solid #3c3c3c;">
<div style="padding:3px; color: '.$cn[$stile].'; border: '.$bn[$stile].'; background-color:'.$bgn[$stile].';"> '.$nome.'<span style=" font: '.$card[$stile].'; color: '.$cd[$stile].';">'.$email.$t.'<a target="_blank" style="color:'.$clink.'" href="http://'.$web.'">'.$web.'</a>
<span style="position:absolute; right:20px;">'.$data.'</span></span></div>';
echo '<div style="padding:3px; margin-top:1px; padding:5px; color: '.$cm[$stile].'; background-color:'.$bgm[$stile].';">'.$messaggio.'</div>
</div>';
}
$cc=count($msgg);
echo '<p> </p><span style="float:left">'.$cc.' commenti</span>';
if (count($msgg)>$v && $_GET['mode']!='view'){
echo "<p align='right'><a href=\"Javascript:void(0)\" onclick=\"javascript:window.open('".$folder."commenti.php?f=".$f."&s=".$s."&mode=view','','resizable=yes,scrollbars=yes,width=600,height=700')\">[Visualizza tutti i messaggi]</a></p>";}
echo '<p> </p>';
// FORM
if ($_GET['mode']!='view'){
echo '<p align="center">...inserisci un commento ...<p> </p>
<script type="text/javascript" src="'.$folder.'check.js">
</script>
<form method="POST" name="comments" onSubmit="return check(this)" action="">
<p>Nome *
<p><input name="nome" size="30" maxlength="20">
<p>Email '; if($vemail==1){echo '(pubblica)';} else echo '(non pubblica)';
echo '<p><input name="email" size="30" ></p>
<p>Sito web - (senza [url]http://)[/url]
<p><input na me="web" size="30" >
<p>Messaggio *
<p><textarea rows="9" cols="30" name="messaggio"></textarea></p>';
echo '<div id="smiles" style="position:absolute; right:10px; bottom:50px; width:35%; border:1px solid #cccccc; padding:5px;"> - Smiles - <br>';
$smile=glob($folder.'smiles/*.*');
foreach ($smile as $smile){
$n=basename($smile, '.gif');
echo '<a href="javascript:(void);" onclick=\'document.comments.messaggio.value += " :'.$n.': "\' title="Inserisci"><img border="0" src="'.$folder.'smiles/'.$n.'.gif" alt="Inserisci"></a> ';}
echo'</div>';
echo '<img src="'.$folder.'captcha.php" style="position:relative; top:10px; border:1px solid black;" alt="Captcha"> <input maxlength="5" size="5" name="userdigit" type="text"> <input type="submit" value="Commenta">
</form>';}
echo "</div>";
?>