hi
I have write a php code that create captcha code and i use it in login form
my captcha code work on local machine but after I my site on host it does not show the captcha code
I check my host and it's gd library is enable
this is my captcha code
<?php
session_start();
function random_string($len=3, $str='')
{ for($i=1; $i<=$len; $i++ )
{
$str.=rand(1,9);
} return $str;}
$rand_str=random_string(5);
$letter1=substr($rand_str,0,1);
$letter2=substr($rand_str,1,1);
$letter3=substr($rand_str,2,1);
$letter4=substr($rand_str,3,1);
$letter5=substr($rand_str,4,1);
$image=imagecreatefrompng("pic.png");
$angle1 = rand(0, 0);
$angle2 = rand(0, 0);
$angle3 = rand(0, 0);
$angle4 = rand(0, 0);
$angle5 = rand(0, 0);
$font1 = '../font/'.rand(1,2).'.ttf';
$font2 = '../font/'.rand(1,2).'.ttf';
$font3 = '../font/'.rand(1,2).'.ttf';
$font4 = '../font/'.rand(1,2).'.ttf';
$font5 = '../font/'.rand(1,2).'.ttf';
$color1=rand(0,10);
$color2=rand(0,10);
$color3=rand(0,10);
$color4=rand(0,10);
$color5=rand(0,10);
$textColor1 = imagecolorallocate ($image, $color1,10, $color3);
$textColor2 = imagecolorallocate ($image, $color4,13, $color2);
$textColor3 = imagecolorallocate ($image, $color2,20, $color1);
$textColor4 = imagecolorallocate ($image, $color3,10, $color5);
$textColor5 = imagecolorallocate ($image, $color5,20, $color4);
$size1 = rand(17,20);
$size2 = rand(17,20);
$size3 = rand(17,20);
$size4 = rand(17,20);
$size5 = rand(17,20);
$y_pos1 = rand(28,28);
$y_pos2 = rand(28,28);
$y_pos3 = rand(28,28);
$y_pos4 = rand(28,28);
$y_pos5 = rand(28,28);
imagettftext($image, $size1, $angle1, 10, $y_pos1, $textColor1, $font1, $letter1);
imagettftext($image, $size2, $angle2, 30, $y_pos2, $textColor2, $font2, $letter2);
imagettftext($image, $size3, $angle3, 55, $y_pos3, $textColor3, $font3, $letter3);
imagettftext($image, $size4, $angle4, 75, $y_pos4, $textColor4, $font4, $letter4);
imagettftext($image, $size5, $angle5, 92, $y_pos5, $textColor5, $font5, $letter5);
$_SESSION['captcha'] = $rand_str;
header("C//ontent-type: image/png");
imagepng($image);
imagedestroy($image);
?>
Thanks for your help