Avatar of Richard Korts
Richard Korts
Flag 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
PHPHTML

Avatar of undefined
Last Comment
Richard Korts

8/22/2022 - Mon
Dave Baldwin

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
Ray Paseur

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
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.....................
Ray Paseur

"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.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
SOLUTION
Dave Baldwin

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Richard Korts

ASKER
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.
Richard Korts

ASKER
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
Richard Korts

ASKER
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
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.