Link to home
Create AccountLog in
Avatar of Richard Korts
Richard KortsFlag for United States of America

asked on

captcha help

See attached.

I am at a loss on how to use this to display the image on an html page.

What should the php / html code be?

I used this; <img src=<?php print "captcha.php"; ?>>

The image displays, but $_SESSION['code'] is NOT set.


Thanks
captcha.php
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

You know you can get the complete code from http://www.captcha.net/ so you don't have to create your own from scratch.  ??
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Richard Korts

ASKER

Dave Baldwin,

I've already tried to go down the Google road, it's basically impossible. I don't have time to explain all the complexities. I was just HOPING you guys could tell me what was wrong with the one I have; I DID NOT create that, I had it "hanging around" & it looks so simple.....................
"Looks simple" is not the same as "I understand the code and process, and it works."  

The general principles are fairly straightforward.  Your "form" script generates a value and stores it in the session.  Your form script translates this value into a visual representation (image, arithmetic problem, etc) that is easy for humans to understand but hard for computers to decode programmatically.  Your "action" script compares the form input values to the representation stored in the session.  Match? OK, it's probably a person.  Mismatch? Discard the input.

At high levels, there is more to this, of course, but for 99% of what we do online, the CAPTCHA article has good solutions. If there is anything you read in the article that you do not understand, please post back and I'll be glad to explain further.
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
The reason I don't seem to be able to use Google ReCaptcha...........

When I go to the link to that, it already has the url listed that I am working on.

I suspect that is because the majority of the site is WordPress; what I am trying to tackle is a custom php page & processing script that are OUTSIDE of WordPress; I was told I could use the same recaptcha, but I need the "public key" which I cannot find in WordPress; I sent an hour or so, don't see where it is.
FYI, I understand the principles of basic captcha.

I've done it MANY times but I can't make it work on this site. I've tried 3 or 4 different approaches, NONE work. I'm using approaches that work on other sites.

Richard
I used a form of the "Honey Pot" technique. I see no way to test it except to force a value in the hidden field; it works fine for a human submission.

Thanks