Jump to content

verificationimage is not working ?


plodos

Recommended Posts

verificationimage.php

<?php
header('Content-type: image/jpeg');

$width = 50;
$height = 24;

$my_image = imagecreatetruecolor($width, $height);

imagefill($my_image, 0, 0, 0xFFFFFF);

// add noise
for ($c = 0; $c < 40; $c++){
$x = rand(0,$width-1);
$y = rand(0,$height-1);
imagesetpixel($my_image, $x, $y, 0x000000);
}

$x = rand(1,10);
$y = rand(1,10);

$rand_string = rand(1000,9999);
imagestring($my_image, 5, $x, $y, $rand_string, 0x000000);

setcookie('tntcon',(md5($rand_string).'a4xn'));

imagejpeg($my_image);
imagedestroy($my_image);
?>

 

Im using this link for show the image....

<img src="verificationimage.php?<?php echo rand(0,9999);?>" width="50" height="24" align="absbottom" />

 

At the before I didnt see any problem..when I changed my hosting company, this script is not show anything(JPEG files)

What can be the reason?

Link to comment
https://forums.phpfreaks.com/topic/113837-verificationimage-is-not-working/
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.