PHP captcha wont show image

junedolphin

New Member
I made this code that is supposed to show me an image with text on it, but the image just wont appear. Any idea?\[code\]<?php header("Content-type: image/png"); $md5 = md5(microtime() * mktime()); $string = substr($md5,0,5); $captcha = imagecreatefrompng('bg.png'); $black = imagecolorallocate($captcha, 0, 0, 0); $line = imagecolorallocate($captcha,233,239,239); imageline($captcha,0,0,39,29,$line); imageline($captcha,40,0,64,29,$line); imagestring($captcha, 5, 20, 10, $string, $black); $_SESSION['key'] = md5($string); imagepng($captcha); imagedestroy($captcha);?>\[/code\]
 
Back
Top