473,718 Members | 2,066 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

reCAPTCHA PHP to stop spam

69 New Member

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?


Nov 12 '07 #1
2 1937
5,058 Recognized Expert Expert
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
69 New Member
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');
  3. $privatekey = "6LeYowAAAAAAAMiylx8fE5Hs85ZfX7KraUler1gi";
  4. $publickey = "6LeYowAAAAAAAFLqbuAe3Byvu98D0EQAZuyvSVH2"; // you got this from the signup page
  5. $smarty->assign( 'recaptcha', recaptcha_get_html( $publickey ) );
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"]);

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

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, what I was wondering was whether this would still be the best practice for this quantity of stop words? There is a larger over head in me defining the array initially as I will have to hard code them all in, alternatively I thought I could import...
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 are my string points. I am trying to debug a project, in VB.NET i could put in a "Stop" statement to make the debugger stop at that point, then i could use F10 and F11 to step through the code.
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...
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 http://www.dotnetmonster.com
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. I have a problem though - when i enter the text from the recaptcha box and press enter it does not do nothing...... someone help please. Thank you
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, Kenny
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 words are entered, I want to exit to another web page. What is the php code that would replace echo "You got it!"; and instead exit to another web page? Thanks very much. linda jimerson<form action="" method="post" > <?php ...
by: Subcomandante | last post by:
Hi, Did anyone try and succeeded to defeat reCAPTCHA script?
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 my contact-us form? Thanks, RAM
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.