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?
Did you know?Explore Trending and Topic pages for more stories like this.
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
No comments posted yet
Your Answer:
Login to answer
291
21
Other forums
sendmail code suddenly not working
Hi Guys, I maintain 3 sites (including my own) I use the following code from a french webmaster that
MS Access data into a html table
Hi everyone, I am quite a novice at php but I have created some helpful scripts that fetch data
f
Menu restriction
How can I restrict the individual menu that would appear when a user logs in so that all users are c
Progress bar tracking file downloads
Hey guys, was wondering if there was a way to track how far a file has been downloaded. I know there
FFmpeg Images 2 Video conversion problem ??
I got folder full of images , number of images = 600 , I want to make a video which plays one image
why this query can delete duplicates ?
why this query can delete duplicates ? Anybody can give me the detailed explanation ?
Tha
string to currency format
Hi guys...
Actually I chunk out some data from txtfile and one of the data contains amount va
Help Optimizing code
Good Morning,
I wrote a small import function for a website of mine and I know there has to b
PHP Login
Hey!
I got this shopcart code online, am trying to modify it but am getting an error when i try a
Formatting echo from database
So I have a database that stores First and last names, then echos them back to a website, as of now