Help with captcha script needed


Posted on 16th Feb 2014 07:03 pm by admin

Hello,

I am working on a script where reCAPTCHA or a similar form of CAPTCHA will be used, for the sake of this example I will talk about reCAPTCHA. I wanted to know how I could have the reCAPTCHA script store a value upon correctly entering a code that will be used by a different script to allow on to proceed?

A snippet of the reCAPTCHA code which will be located in a file called recaptcha.php.

Code: (text) if ($resp->is_valid) {
[b] $captcha = "1";
# in a real application, you should send an email, create an account, etc[/b]
} else {
# set the error code so that we can display it. You could also use
# die ("reCAPTCHA failed"), but using the error message is
# more user friendly
$error = $resp->error;
}
}

I bolded the part of interest, how would I be able to use a variable like

Code: (text) $captcha = "1";
In a completely different file that is called login.php to allow one to login if the captcha is correct? The value would only be needed for that session of course. I want to use this method because the captcha script might be used in multiple locations so I figure this route would be easier and allow for quicker modifications than have the script called each time in different files for instance.

The only alternative I can think of is using MySQL or local files to store the answer but that won't be very logical for a script that could have hundreds of requests an hour.

Any help would be appreciated, thanks in advance

291 Like 21 Dislike
Previous php-forum Next php-forum
Other php-forum

How To Make More Than One Redirection with PHP on the same page?
Hey im trying to do a direction page where it open differently link direction pages every time som

Using Microsoft Exchange Server with PHP
Hi,

I wanted to know if its possible to fetch email attachments from the exchange server usin

Including calander to page - will not show other months than current??
im trying to add an existaing calander onto a profile page by using Code: <?php include "

ereg_replace issue
hi there people

i have this code happening with regards to my wamp server. is this something

for loop without same $i digits?
Hi,

Can some guru please advise how can I accomplish this with a simple for loop ?

I

if description does not contain the following words
Hello everyone,

I am parsing a MS Excel (.xls) file and adding it's content to a mySQL databa

elseif help!
OK so I'm new to the site, as well as PHP altogether (Trying my hand at managing an online RPG) and

Internal Server Error issues
This has been bothering me for weeks and I've been trying to solve it without asking for help, but e

Problem with PHP code- simple contact form
I'm relativily new to PHP; I know HTML and CSS stuff but I have a problem- I have a contact form wit

trim function issues
Hi guys, total noob here...

So I've been tinkering around with a html and am using php to em

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash