Jump to content
Sign in to follow this  
pippin62

reCAPTCHA and provided CRM form

Recommended Posts

I've been given form code for posting to a CRM to process, but the client wants reCAPTCHA included. Am I right in thinking that the reCAPTCHA form validation needs to be handled at the server side processing end? It can't be validated separately end then sent to process can it?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • By GrahamUK33
      Has anyone successfully installed reCAPTCHA on to their contact page to help stop the spam? 
      According to the reCAPTCHA website at https://developers.google.com/recaptcha/ its 'easy to add, advanced security'. 
      I have been trying to use V2 with the checkbox option, it is clearly shown what you need to do to call up reCAPTCHA, but come to the code that is needed within a php form it is lacking easy to understand instructions. 
      After spending a day trying to get reCAPTCHA to work, I have given-up. 
      What are the other ways of stopping spam without putting someone off from using a simple contact form? Is there something simple to be added? 
    • By jerseydudek
      Hi,
       
      I'm trying to set up a Google Recaptcha on a form I've already set up. It works fine in every other way, I just can't get the Recaptcha to verify server side.

      Following Googles guidelines (at https://www.google.com/recaptcha/admin#list) I've got the first part set up no problem.
       
      But the server side part is undocumented in Google's guidelines it seems. I'm not sure what to do with the form submission php file at all and there's not much help from Google.

      So can someone please advise what I need to add to the php file please. I've put the html and php for the form below to show where I'm at.

      As I said above, I've got the Recaptcha working on the HTML side. It's the server side part I'm struggling with.

      This is where I'm at:

      The HTML form with the capture front end set up:
      <form method="post" action="contact.php"> <h2 align="center"> QUOTE REQUEST FORM</h2> <fieldset> <legend>We will respond to all enquiries within 24 hours. </legend> <p><h3>All fields marked with an <span class="asterix">"✱"</span> are required</h3></p> <p> <label for="name"><span class="asterix">✱</span>Name</label> <input name="Name" type="text" required/> </p> <p> <label for="emailaddress"><span class="asterix">✱</span>Email Address</label> <input name="Emailaddress" type="text" required/> </p> <p> <label for="telephone"><span class="asterix">✱</span>Telephone</label> <input name="Telephone" type="text" required/> </p> <p> <label for="enquiry" >Please enter any further details</label> <textarea name="Enquiry" type="text" required/></textarea> </p> <p> <div class="g-recaptcha" data-sitekey="my site key here"></div></p> <p> <input type="submit" value="Submit" /> <input type="reset" value="Reset" /></p> </fieldset> </form> And this is where I need to add the verification code in the php file:
      <?php $EmailFrom = "me@myplace.com"; $EmailTo = "me@myplace.com"; $Subject = "Quote Request"; $Name = Trim(stripslashes($_POST['Name'])); $Emailaddress = Trim(stripslashes($_POST['Emailaddress'])); $Telephone = Trim(stripslashes($_POST['Telephone'])); $Journeystart = Trim(stripslashes($_POST['Journeystart'])); $Journeydestination = Trim(stripslashes($_POST['Journeydestination'])); $Howmany = Trim(stripslashes($_POST['Howmany'])); $Month = Trim(stripslashes($_POST['Month'])); $Day = Trim(stripslashes($_POST['Day'])); $Enquiry = Trim(stripslashes($_POST['Enquiry'])); // prepare email body text $Body = ""; $Body .= "EmailFrom: "; $Body .= $EmailFrom; $Body .= "\n"; $Body .= "Subject: "; $Body .= $Subject; $Body .= "\n"; $Body .= "Name: "; $Body .= $Name; $Body .= "\n"; $Body .= "Emailaddress: "; $Body .= $Emailaddress; $Body .= "\n"; $Body .= "Telephone: "; $Body .= $Telephone; $Body .= "\n"; $Body .= "Enquiry: "; $Body .= $Enquiry; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=messagesent.html\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=messagenotsent.html\">"; function check_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } } ?> Any advice really appreciated and I'm sure many people will benefit from it too.
  • Recently Browsing

    No registered users viewing this page.

  • Member Statistics

    • Total Members
      59,131
    • Most Online
      4,970

    Newest Member
    Kho Sàn Gỗ
    Joined
  • Forum Statistics

    • Total Topics
      65,989
    • Total Posts
      454,479
×