sayedsohail Posted August 23, 2007 Share Posted August 23, 2007 Removed xampp and installed php apache mysql? Hi guys, When i migrated from xampp, i got a small problem, when uninstalled xampp and installed apache, php and mysql separately. My captach file is not showing up the image on my login page. login.php file <?php ....////Just avoided loading entire form/// <input id="txtCaptcha" type="text" name="txtCaptcha" value="" maxlength="10" size="32" /> </td> <td> <img id="imgCaptcha" src="create_image.php" /> </td> ?> ....... captch file: [/code] <?php session_start(); //Send a generated image to the browser create_image(); exit(); function create_image() { $md5_hash = md5(rand(0,999)); $security_code = substr($md5_hash, 15, 5); $_SESSION["security_code"] = $security_code; $width = 100; $height = 20; $image = ImageCreate($width, $height); $white = ImageColorAllocate($image, 255, 255, 255); $black = ImageColorAllocate($image, 0, 0, 0); $grey = ImageColorAllocate($image, 204, 204, 204); ImageFill($image, 0, 0, $black); ImageString($image, 3, 30, 3, $security_code, $white); ImageRectangle($image,0,0,$width-1,$height-1,$grey); imageline($image, 0, $height/2, $width, $height/2, $grey); imageline($image, $width/2, 0, $width/2, $height, $grey); //It seems i got problem, somewhere here to do with header, i am not good at understanding headers at all// header("Content-Type: image/jpeg"); ImageJpeg($image); //Free up resources ImageDestroy($image); } ?> [/code] Quote Link to comment https://forums.phpfreaks.com/topic/66341-solved-migrated-from-xampp-captcha-file-stop-showing-image/ Share on other sites More sharing options...
sayedsohail Posted August 23, 2007 Author Share Posted August 23, 2007 I was able to solve on my own, as i hate using xampp, in live environment, instructions are on this website. and make sure you copied php g2.dll file inside the php ext directory. if someone needs feel free to pm. regards, sohail http://www.webcheatsheet.com/php/install_and_configure.php Quote Link to comment https://forums.phpfreaks.com/topic/66341-solved-migrated-from-xampp-captcha-file-stop-showing-image/#findComment-331953 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.