Jump to content

Problems With Verification Image


misse

Recommended Posts

am trying to use CAPTCHA code for verification image in a registration page on my localhost using wamp server, i tried several codes to do this, everytime i try one the verification image doesn't appear at all !! my class mates told me that CAPTCHA doesn not work with wamp & localhost. does anyone has a suggestion for another ver. image code that works with wamp and localhost???Thanks in advance :)

Link to comment
Share on other sites

There's no reason why a given piece of code would work on a WAN server vs a LAN server, assuming you have the correct software installed. Do you have the GD extension for PHP enabled? GD will probably be required to use a captcha class that generates its own images. If you don't know, create a page with this and run it:

<?phpphpinfo();?>

Scroll down and look for a section titled GD or GD2. If it's enabled, you'll see it listed there. If it's not enabled, that's probably the reason.You can also enable error logging and look for error messages. If PHP has an error it doesn't just silently fail and stop, it tells you what the problem is.error_reporting(E_ALL);ini_set('error_log', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'error.log');ini_set('html_errors', 0);ini_set('log_errors', 1);ini_set('display_errors', 0);You'll find errors inside the error.log file in the same directory as the script with that code.

Link to comment
Share on other sites

If GD was included with PHP (I'm not sure if WAMP includes GD or not), then you can open the configuration file and find the area where it lists the available extensions. If the GD extension is disabled with a semicolon, you remove the semicolon. e.g., change this:;extension=php_gd2.dlltoextension=php_gd2.dllYou may need to restart Apache after you change the configuration file. http://www.php.net/manual/en/configuration.file.phpStep 1 should really be to look for error messages though, before changing PHP's configuration.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...