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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.