07-10-2011, 01:29
(Ten post był ostatnio modyfikowany: 07-10-2011, 01:30 przez lokotheboy.)
Dzięki,ale teraz pojawia się:
Cały plik php wyglada tak:
Kod PHP:
Warning: Cannot modify header information - headers already sent by (output started at ............................................................/komentator.php on line 23
Cały plik php wyglada tak:
Kod PHP:
<p> </p><p>
<?
ob_start();
?>
<?
if(isset($_POST['submit']))
{
$im=$_POST['imie']; $message=$_POST['message'];
if ($message && $im)
{
if(isset($_COOKIE['czas']))
{
echo'<b style="color:red;">Komentarz możesz dodać co 15minut.</b>';
}
else
{
$date = date("Y-m-d H:i:s");
$message = "<B>$im</B> -- $date<P> $message <BR><HR>";
$fp = fopen (basename($_SERVER['PHP_SELF']).".text", "a");
fwrite ($fp, $message);
fclose ($fp);
setcookie("czas", "1", time()+(15*60));
}
}
else
{
echo '<b style="color:red;">Wypełnij wszystkie pola.</b>';
}
}
?>
<FORM action="" method="post">
<b>Twój nick:</b><BR><INPUT name="imie" type="text" size="20"><BR>
<b>Komentarz:</b><BR><TEXTAREA name="message" rows=8 cols=30 wrap=virtual>
</TEXTAREA><BR>
<INPUT name="submit" type="submit" value="Dodaj komentarz">
</FORM>
<?
@readfile(basename(($_SERVER['PHP_SELF'].".text")));
$message ="";
?>
<?
ob_end_flush();
?>
</p>