Jump to content

captcha


ecabrera

Recommended Posts

why does this not display my hosting supports gd

 

<?php
session_start();
create_image();

function create_image()
{
$rand = md5(rand(0, 9999999));
$vaule = substr ($rand, 10, ;

//widht and height is the width of the box
$width = 150;
$height = 30;

//the will be ther sixe of the box
$image = imagecreate($width, $height);

$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image, 255, 255, 255);
$grey = imagecolorallocate ($image, 132, 132, 132);
$blue = imagecolorallocate ($image, 138, 197, 255);

//the bg of the image
imagefill($image, 0, 0, $blue);

//imagetext
imagestring($image, 5, 15, 7, $vaule, $black);

//middle line and down line
imageline($image, 0, $height/2, $width, $height/2, $grey);
imageline($image, $width/2, 0, $width/2, $height, $grey);
//hor line
image($image, 0, 0, $width, $height, $grey);
image($image, 0, $height, $width, 0, $grey);


//desplay image
imagepng($image);
imagedestroy($image);

//start session
$_SESSION[captcha_key];
}

?>

Link to comment
https://forums.phpfreaks.com/topic/245735-captcha/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.