W miejscu, w którym mam komentarze pojawia się błąd:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/lokotheb/domains/........menu.php:20) in /home/lokotheb/domains/............komentator.php on line 3 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/lokotheb/............menu.php:20) in /home/lokotheb/domains/.....................komentator.php on line 3
Dodatkowo nie pojawia się kod captcha - brak literek, tło jest.
capcha.php
<?php /* config */ $imgPatch = "images-captcha/"; $fntPatch = "fonts/"; /* script */ $i = imagecreatefromjpeg($imgPatch . $images); imagettftext($i, 25, rand(-7, 7), rand(1, 20), ceil(next(getimagesize($imgPatch . $images))/2)+10, imagecolorallocatealpha($i, 255, 255, 255, 60), $fonts, $_SESSION["captcha"]); imagejpeg($i); imagedestroy($i); ?>
komentator.php
<?php $status = ""; { { $status = "info"; } else { $status = "error"; } } $_SESSION["captcha"] = substr(str_replace(array(1, 0, "O", "I", "L"), array("X"), strtoupper(md5(date("Y-m-d H:i:s" . rand(0, 999))))), 0, 6); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" /> <title>Test formularza zabezpieczonego captcha</title> <meta name="author" content="JG24 TEAM - Marusz" /> <meta name="copyright" content="2009" /> <style type="text/css"> * { font-family: Arial, Verdana; font-size: 12px; } input, textarea { display: block; padding: 3px; margin: 2px 0; border: 1px solid grey; } form { padding: 15px; } div#error { border: 2px solid #000; background-color: #ff0000; color: #fff; font-weight: bold; padding: 10px; } div#info { border: 2px solid orange; background-color: yellow; color: #000; font-weight: bold; padding: 10px; } </style> </head> <body> <?php { } ?> <form method="post"> Imię: <input type="text" name="imie" value="<?php if ( isset ( $_POST["imie"] ) && $status != "info" ) { echo htmlspecialchars($_POST["imie"]); } ?>" /> Tekst: <br /> <textarea name="tekst"><?php if ( isset ( $_POST["tekst"] ) && $status != "info" ) { echo htmlspecialchars($_POST["tekst"]); } ?></textarea> <hr /> <img src="captcha.php" alt="captcha" /> <br /> Przepisz tekst z powyższego obrazka: <input type="text" name="captcha" value="" /> <hr /> <input type="submit" name="submit" value="Wy?lij formularz" /> </form> </body> </html>
Skąd ten błąd?
Z góry dziękuję i pozdrawiam,