473,406 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

reCAPTCHA PHP to stop spam

69
Hi,

Has anyone used this successfully in PHP to prevent spam mails sent from HTML forms? I've added it to a form of mine and it seems a bit hit and miss. I incorrectly enter the captcha and it correctly says its incorrect. I try again with another incorrect response and it accepts it?

Am I doing something wrong or is there a problem with reCAPTCHA?

Thanks,

Sean
Nov 12 '07 #1
2 1926
Atli
5,058 Expert 4TB
Hi Sean.

There must something be a little of for it to act like that. It could simply be that you overlooked some minor detail when you wrote your code.

Did you write the code from scratch or are you using something you got from somewhere else?
Could you show us the code that is likely to be causing this behavior?
Nov 12 '07 #2
Sebarry
69
Hi Thanks, yes my code is as follows. I'm using Smarty with PHP.

At the top of the PHP file:

Expand|Select|Wrap|Line Numbers
  1. require_once('includes/recaptcha-php-1.9/recaptchalib.php');
  2.  
  3. $privatekey = "6LeYowAAAAAAAMiylx8fE5Hs85ZfX7KraUler1gi";
  4. $publickey = "6LeYowAAAAAAAFLqbuAe3Byvu98D0EQAZuyvSVH2"; // you got this from the signup page
  5. $smarty->assign( 'recaptcha', recaptcha_get_html( $publickey ) );
  6.  
To process the form:

Expand|Select|Wrap|Line Numbers
  1. $resp = recaptcha_check_answer ($privatekey,
  2.     $_SERVER["REMOTE_ADDR"],
  3.     $_POST["recaptcha_challenge_field"],
  4.     $_POST["recaptcha_response_field"]);
  5.  
Sean

Hi Sean.

There must something be a little of for it to act like that. It could simply be that you overlooked some minor detail when you wrote your code.

Did you write the code from scratch or are you using something you got from somewhere else?
Could you show us the code that is likely to be causing this behavior?
Nov 12 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Rob Meade | last post by:
Lo all, Ok - I'm adding site search functionality to a database driven website. I have a list of 390 stop/ignore words, having looked at ASPFAQ already I see that the example uses an array,...
4
by: DKode | last post by:
Hello, I have been using VB.NET for about 5 months and now I decided it's time to start using C#.NET because I like the syntax setup alot more, because it more closely resembles php/perl which...
26
by: Ricardo | last post by:
I made a program that generate random numbers and put it in a listbox when the user click go. The problem is: how can i made a button stop, to stop the method that is running??? s...
7
by: dotnetprogrammer via DotNetMonster.com | last post by:
I have an NT Service written in c# (.net framwork 2.0). When it hits a certain error condition, I want it to be to cause itself to stop. How can I do this? -- Message posted via...
1
by: dineshkaku | last post by:
Does anyone know any codes for live validation of the recaptcha? My registration process is full of live validations and the register buttin does not get activated unless all fields are error free....
3
by: KHurst | last post by:
How do I get rid of reCaptcha fields that are emailed when I submit a form? I guess what I am asking is how do you exclude unwanted fields from being posted to email from a form in PHP? Thanks,...
10
by: Linda Jimerson | last post by:
Hello - Thanks for any help you can provide. Below is code I am using for "recaptcha" form validation. It works well EXCEPT that (instead of echoing 'You got it!') as shown below when the accurate...
1
by: Subcomandante | last post by:
Hi, Did anyone try and succeeded to defeat reCAPTCHA script?
2
ram09
by: ram09 | last post by:
Hi All, I have a contact-us form in my asp.net website and I want to prevent spamming without using a recaptcha. Is there any way or technique where I can prevent people from playing/spamming in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.