INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

inherited a wordpress site and need to add reCaptcha

inherited a wordpress site and need to add reCaptcha

(OP)
I just inherited a wordpress site that looks like someone created a custom theme.  I know almost nothing about wordpress or php but I have to add a captcha to a couple of contact forms.  I found a contact.php file that contains the code of the "contact page"  I modified this code and added the reCaptcha code so that the reCaptcha box is displayed and updates on the contact form when it displays. But there is a bit of verification code that has to run "between the form tags."

sorry i dont remember how to quote code in a post but this is the complete code for the contact.php page:

<p>Your Name (required)<br />
    <span class="wpcf7-form-control-wrap your-name"><input type="text" name="your-name" value="" class="wpcf7-validates-as-required" size="40" /></span> </p>
<p>Your Email (required)<br />
    <span class="wpcf7-form-control-wrap your-email"><input type="text" name="your-email" value="" class="wpcf7-validates-as-email wpcf7-validates-as-required" size="40" /></span> </p>
<p>Subject<br />
    <span class="wpcf7-form-control-wrap your-subject"><input type="text" name="your-subject" value="" size="40" /></span> </p>
<p>Your Message<br />
    <span class="wpcf7-form-control-wrap your-message"><textarea name="your-message" cols="40" rows="10"></textarea></span> </p>
                <!-- my added code rhb -->
                <script type="text/javascript"
                src="http://api.recaptcha.net/challenge?k=mykey" ></script>

                <noscript>

                <iframe src="http://api.recaptcha.net/noscript?k=mykey" height="300" width="500" frameborder="0"></iframe>

                <textarea name="recpatcha_challenge_field" rows="3" cols="40"> </textarea>
                <input type="hidden" name="recaptcha_response_field" value="manual_challenge">

                </noscript>

                <!-- end recaptcha code -->

<p><input type="submit" value="Send" /></p>


The problem is that all the references I can find say I have to put another bit of code "between the form tags"

but it looks to me like wordpress generates this form somehow on the fly because i can not find any actual form anywhere.

Can anybody point me to where to look to put the other code?

I can not find anywhere in wordpress that looks like the correct location for this code.

require_once("recaptchalib.php');
$privatekey="mykey";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
die ("The rcCaptcha wasnt entered correctly. Go back and try again" .
"(reCAPTCHA said: " . $resp->error . ")");
}

any help would be appreciated..

once again sorry i forgot how to quote code so it is easier to read.

 

RE: inherited a wordpress site and need to add reCaptcha

Without access to your site files it is virtually impossible to help you.

However there are good alternatives to the (horrible) recaptcha which could be implemented without knowing too much about your site. Visit rathercurious.net and search for captcha. Or search in this site for similar code that I have posted.  

RE: inherited a wordpress site and need to add reCaptcha

(OP)
thanks, I have read about better alternatives to the capcha stuff, i would like to avoid it if i can. Ill take a look at that and see if i can figure it out
 

RE: inherited a wordpress site and need to add reCaptcha

There are great free form plugins that have built in recaptcha. i.e. fast secure contact form or you can use the free jotform.com service to embed a contact form.  

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close