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 Like 21 Dislike
Previous forums Next forums
Other forums

Socket Server
In my following socket server, I am trying to listen to a connection through port 12345 in my web br

Port scanner problem
Hai
recently i developed one app through which u can check the opened and closed ports under an

listcube issue
Hi
I have a virtual cube ZREMOTE. I use Tcode "listcube" to retrieve contents. I use of the

urldecode question
How would I format this line of code properly?

<?php echo urldecode($_GET['Title']); ?

Auto install
Hi I have a directory lets say "apps" that I then have more folders ie "email",

Accessing element of object array
Hello

My object looks like this:


Array ( [0] => User Object ( [id] =>

upload photo limits
ive got a upload photo script and im just trying to make more secure currently it limits size and as

insert Multiple rows into the table from that table data
Hi All,

I have a requirement like to insert mulitple rows into the table from that

PHP mail() with images
I'm trying to get images to send along with my HTML e-mail sent through PHP mail(). I only tried vie

The repetition structure: the while statement not working
New programming student, have assignment as follows:
A restaurant has 4 lunch combos for custom

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