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
Keeping track of php uploads
Hello all.
I was looking at the way PHP handles file uploads.
It seems that PHP uses a tem
problem when runing a funciton
I am trying to connect to database using a funciton in a functions.php
<?php
funct
I need desperate help with this php code integrated with flash please
Can someone please help me with this php code which I have been stuck on for weeks . I am trying to
how to make database item unique
Hey guys,
is it possible to do this:
I have the database item $title being pulled for
preg_match logical error
Code: <?php
$s = file_get_contents("page.html");
preg_match('/<div cla
Email logic not working
I would like to send an email using the php email() function then if it does execute i.e sends i wou
Not showing whole name with mail () script
I sent up a simple mail form with the PHP mail() script. One problem is when it sends an email with
Help With editting and deleting form
Hallo !!
So look at this image :
http://img194.imageshack.us/img194/8272/snapshot5f.pn
Detail Expenses Report by Cost Center
I would like to obtain a report out of SAP that shows a list of expenses by cost center that shows t
Function
How can I make this function that once you click the link in the code it takes you to a new page wit