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
Read from a text file after a specific word
Hi all.
I have a text file that looks like the one below.
I know how to open the text fi
php/xmlrpc class issue
I am working on xml-rpc in php to start with.
I have a class that only has variables defined
insert quotes
Hi,
I have an output like this:
Code: john,18,Cancer
How can I change this to
Code:
Change image filetype on upload?
Hi,
I've got a form which uploads an image to the server.
Is it possible to change the image t
Taylor Series Function
So I am working a a project for my intro C++ class, and I am having some trouble with a function for
Need a fuction to count entries in a field
Hi
I need a fuction to count how many times a email address is entered in to a field.
I ma
Validating time
Hi Guys
what do you think of the following approach to validate a 24hour time:
http://
with clause
hi all, i have a big query that usually access the same table more than once. for example, i have s
Calander layout
Hi i know this sounds like a simple question but i cant find the answer to it anywhere i have added
Mass activity scheduling
Hi experts,
Im facing some problems to deal with mass activity jobs.
When I run some