Are you trying to incorporate someone else's captcha code into one of your existing web pages, or what? Post your code. It's impossible to offer you any real help without that.
Hello there! It's always good to post as much information as is possible for each situation. If there is code that has a problem, post it. If you're using a tutorial, post it. If there's a page we can look at that isn't showing up correctly, post it and the code it uses...etc. etc. Be as descriptive as possible! Good luck!
/* Now to make it a little bit harder for any bots to break, assuming they can break it so far. Lets add some lines in (static lines) to attempt to make the bots life a little harder */ imageline($captcha,0,0,39,29,$line); imageline($captcha,40,0,64,29,$line); /* Now for the all important writing of the randomly generated string to the image. */ imagestring($captcha, 5, 20, 10, $string, $black);
/* Encrypt and store the key inside of a session */
$_SESSION['key'] = md5($string);
/* Output the image */ header("Content-type: image/png"); imagepng($captcha); ?>
thats the code he is using, to save you all from multipages of code i compiled into easy view
Your logic is looking to see if the function "imagecreatefromjpeg" does NOT exist (evident from the ! which means "NOT"), but your text is printing "exists." Do it like this:
PHP Code:
<?php
if (function_exists('imagecreatefromjpeg')) {
echo 'imagecreatefromjpeg() exists.';
} else {
echo 'imagecreatefromjpeg() does not exist.';
}
?>
Location: Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
Posts: 7,686
Thanks: 42
Thanked 637 Times in 625 Posts
You don't have the GD library installed. You are confused as to what you are checking on those "if" statements-- you are saying if (NOT function_exists()) echo 'function exists!', so the fact they are all returning 'function exists' means they don't exist.