carlbulman Posted September 6, 2010 Share Posted September 6, 2010 The following code is what I am trying to use for doing a form captcha style verification and all it is throwing back when I load the page is an image of the website address. Does anyone here know where I am going wrong? I have been at this all day and gotten nowhere. Thanks in advance <?php session_start(); $rndval = rand(1000, 9999); $_SESSION['rndnum'] = md5($rndval); $img = imagecreate(60, 30); $bgc = imagecolorallocate ($img, 255, 251, 205); $fontcolor = imagecolorallocate ($img, 0, 0, 0); imagestring ($img, 5, 5, 8, $rndval, $fontcolor); header('Content-type: image/jpeg'); imagejpeg($img); imagedestroy($img); ?> Quote Link to comment Share on other sites More sharing options...
carlbulman Posted September 6, 2010 Author Share Posted September 6, 2010 Solved my own problem by helping another guy on here. To much coffee Was a simple error solved by changing ' for a " in the header: header('Content-type: image/jpeg'); it now reads: header("Content-type: image/jpeg"); Quote Link to comment Share on other sites More sharing options...
objnoob Posted September 6, 2010 Share Posted September 6, 2010 It should have worked using single quotes as well?! Quote Link to comment Share on other sites More sharing options...
coupe-r Posted September 6, 2010 Share Posted September 6, 2010 it does Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.