
mam problem z systemem captcha chodziarz nie wiem czy można to nazwać systemem.
a więc napisałem sobie prosty skrypt na captcha wygląda on tak:
<? include('funkcje.php'); { } $width = 80; $height = 20; $image = imagecreate(80, 20); $bg_color = imagecolorallocate($image, 0x33, 0x66, 0xFF); imagefilledrectangle($image, 0, 0, $width, $height, $bg_color); $text = random_text(6); $font = 5; $y = imagesy($image) / 2 - imagefontheight($font) / 2; $fg_color = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); imagestring($image, $font, $x, $y, $text, $fg_color); $_SESSION['captcha'] = $text; imagepng($image); imagedestroy($image); ?>
wszystko ładnie działa jak odpalam skrypt niezależnie czyli np: http://localhost/captcha.php
ale jak chce go wyświetlać na stronce to wywala mi błąd.
a o taki:
Kod
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\index.php:17) in <b>C:\xampp\htdocs\captcha.php</b> on line <b>27
a 17 linia w index.php to
i nie mam pojęcia jak temu zaradzić.
sądzę że mi ktoś pomoże rozwiązać mój problem