Witam.
Na pewnej stronie znalazlem krotki tutorial jak zrobic cos w stylu captchy.
Oto kod strony pic.php, ktora ma na celu wygenerowanie obrazka
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
$slowa=file('hasla.txt');
$nr=$_GET['id'];
$slowo=$slowa[$nr];
$wysokosc=20;
$szerokosc=60;
$pic=ImageCreate($szerokosc,$wysokosc);
$bialy=ImageColorAllocate($pic,255,255,255);
$czarny=ImageColorAllocate($pic,0,0,0);
$szary=ImageColorAllocate($pic,150,150,150);
ImageFill($pic,1,1,$bialy);
for($i=0;$i<200;$i++)
{
$los1=rand(0
,$szerokosc);
ImageLine($pic,$los1,$los2,$los1,$los2,$szary);
}
for($i=0;$i<count($slowa);$i++)
{
ImageString
($pic,$rozmiar,$i*10
+7
,3
,trim($slowo[$i]),$czarny); }
Header("Content-type: image/gif"); ImageGIF($pic);
?>
</body>
</html>
Jednak skrypt nie generuje obrazka tylko wywala blad:
"Obrazek "http://.../pic.php" nie może zostać wyświetlony, ponieważ zawiera błędy."
Prosil bym o pomoc