Answer the question
In order to leave comments, you need to log in
Why can't the generated image (Captcha) be displayed?
A simple, notorious captcha was written for the Site , just to be. The problem is that on the local - it all works fine, but as soon as it is transferred to the hosting - it stops working. If you run this file manually, it will display an error referring to line 11, that is, to this one:
imageTtfText($im, 28, -25, 30, 25, $c, __DIR__."/fonts/18928.ttf", $rand);
<?php
session_start();
$rand = mt_rand(1000000, 9999999);
$_SESSION["rand"] = $rand;
$im = imageCreateTrueColor(250,90,);
$c = imageColorAllocate($im, 55, 55, 55);
imageTtfText($im, 28, -25, 30, 25, $c, __DIR__."/fonts/18928.ttf", $rand);
header("Content-type: image/png");
imagePng($im);
imageDestroy($im);
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question