Здравейте имам този код:
но защо получавам тази грешка:
ето вижте http://racerbg.com/captcha.php
PHP:
<?php
session_start();
$string = "";
for($i = 0; $i < 6; $i++) {
$string .= chr(rand(97, 122));
}
$_SESSION['rand_code'] = $string;
$dir = "http://racerbg.com/font/";
$image = imagecreatetruecolor(170, 25);
$black = imagecolorallocate($image, 0, 0, 0); //Черен
$color = imagecolorallocate($image, 200, 100, 90); //Червен
$white = imagecolorallocate($image, 255, 255, 255); //Бял
imagefilledrectangle($image, 0, 0, 170, 60, $white);
imagettftext($image, 8, 0, 2, 20, $color, $dir."pihab.ttf", $_SESSION['rand_code']);
header("Content-Type: image/png");
imagepng($image);
?>
но защо получавам тази грешка:
Warning: imagettftext() [function.imagettftext]: Could not find/open font in /home/racerbgc/public_html/captcha.php on line 16
Warning: Cannot modify header information - headers already sent by (output started at /home/racerbgc/public_html/captcha.php:16) in /home/racerbgc/public_html/captcha.php on line 17
‰PNG IHDRЄ.J"VIDAThЃнСA А0Аїз!cЏ& zЧ;3‡Є·А&ыУмOі?Ню4ыУмOі?Ню4ыУмOі?Ню4ыУмOі?Ню4ыУмOі?Ню4ыУмOі?н3Н/6;ЛОIEND®B`‚
ето вижте http://racerbg.com/captcha.php