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
No comments posted yet
Your Answer:
Login to answer
291
21
Other forums
get font info from a font file
hello,
Does anyone know how to get font info from a font file ... using php of course !
<
Help Optimizing code
Good Morning,
I wrote a small import function for a website of mine and I know there has to b
Sending a hyperlink through mail
HI all,
I am sending a mail to outlook mailbox of a user using FM SO_NEW_DOCUMENT_ATT_S
problem with sql querry in php script
Hello guys,
What I want to do is I want to read out a csv file and then but te conent ot the
How do I use ValidatorCallout extender in Login control?
Hi,I'd like to customize the look and feel of the login control a little bit. One thing I'd love to
Month String to Numeric?
Hi guys,
Given a month as a string, is there a simple way to find the numeric representation
drop-down with sub-category appear
Hello,
i know how to build a simple dro-down list, im looking for a code when im gonna choose
natcasesort works on one server but not on another
Hi
I have a problem that I was hoping that someone can help me with.
I'm trying to use
Track downloads' status
Hello,
I need to make somehow, some system, to track whether downloads are completed or faile
problems with script
I made a small script wich exchanges points in my website:
<?php
session_start