Captcha problem. No image :(

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
VeroneK
-


Joined: 14 Jun 2008
Posts: 1

PostPosted: Sat Jun 14, 2008 8:43 am    Post subject: Captcha problem. No image :( Reply with quote

Hello. Im new user of Abyss Web Server.

I have my own Private server to game. And I'm using register script.

I installed PHP on Abyss Web Server, and put my scripts into htdocs. But when I'm opening script, there is no CAPTCHA image :(

Quote:
<?php

class Captcha
{
private $font = 'arial.ttf';

function generateCode($characters) {
$possible = '23456789bcdfghjkmnpqrstvwxyz';
$code = '';
for($i=0;$i<$characters;$i++) {
$code .= substr($possible, mt_rand(0, strlen($possible)-1), 1);
}
return $code;
}

function __construct($width='120',$height='40',$characters='6') {
$code = $this->generateCode($characters);
$_SESSION['captcha'] = $code;
$font_size = $height * 0.60;
$image = imagecreate($width, $height);
$background_color = imagecolorallocate($image, 0, 0, 0);
$text_color = imagecolorallocate($image, 255, 255, 80);
$noise_color = imagecolorallocate($image, 255, 100, 80);
for($i=0; $i<($width*$height)/3;$i++) {
imagefilledellipse($image,mt_rand(0,$width)
,mt_rand(0,$height)
,1,1
,$noise_color);
}
for($i=0;$i<($width*$height)/150;$i++) {
imageline($image,mt_rand(0,$width)
,mt_rand(0,$height)
,mt_rand(0,$width)
,mt_rand(0,$height)
,$noise_color);
}
$textbox = imagettfbbox($font_size, 0, $this->font, $code);
$x = ($width - $textbox[4])/2;
$y = ($height - $textbox[5])/2;
imagettftext($image, $font_size, 0, $x, $y, $text_color, $this->font , $code);

header('Content-Type: image/jpeg');
imagejpeg($image);
imagedestroy($image);
}
}

?>


This is that Captcha.

And site:

https://91.121.75.11:50004/

I tried on IE, Mozilla, Opera... No working.

When I'm trying open it (Righ Mouse -> Show Image):

Quote:
Fatal error: Call to undefined function imagecreate() in C:\Abyss Web Server\htdocs\Captcha.php on line 20


On XAMPP, or other Apatche service, everything was good.

Can anyone help me?

And sorry for my bad english. I hope you understand me :)
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3718
Location: USA, GA

PostPosted: Sat Jun 14, 2008 4:02 pm    Post subject: Reply with quote

I just visited that URL and saw the security image. I guess you already fixed the problem?
_________________
Computer Programmer & Networking Specialist



Last edited by TRUSTAbyss on Sat Jun 14, 2008 10:02 pm; edited 1 time in total
Back to top View user's profile Send private message Visit poster's website MSN Messenger
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Sat Jun 14, 2008 5:34 pm    Post subject: Reply with quote

I see it too. And btw, congrats on the OVH server :-) Mine is in the same data center :-)
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group