如何在Wordpress中的自定义邮件表单中使用插件添加Captcha?

时间:2014-02-14 07:18:08

标签: wordpress captcha

我正在使用WP-reCAPTCHA插件,现在我想在我的自定义表单中添加它:

<form>    
    <div class="span3 form_fields"><input type="text" name="fname" id="fname" placeholder="First Name (required)" class="span3"/></div>
    <div class="span3 form_fields"><input type="text" name="lname" id="lname" placeholder="Last Name (required)" class="span3"/></div>
    <div class="span3 form_fields"><input type="text" name="phone" id="phone" placeholder="Phone Number (required)" class="span3"/></div>
    <div class="span3 form_fields"><input type="text" name="company" id="company" placeholder="Company/ Institute Name (required)" class="span3"/></div>
    <div class="span3 form_fields"><input type="text" name="email" id="email" placeholder="Email (required)" class="span3"/></div>
    <div class="span3 form_fields"><select style="width:100%!important;" name="country" id="country">
            <option value="">Select country</option>
            <option value="India">India</option>
            <option value="USA">USA</option>
        </select>
    </div>
    <div class="span6 form_fields"><textarea placeholder="Message (required)" name="message" id="message" class="span6"/></textarea></div>
    <div class="clearfix"></div>

    //here i want to add captcha     

    <div><button type="button"  class="btn btn-inverse" id="submit" onclick="contactsales();">Submit</button></div>
</form>

请帮我找出简单的解决方案?

1 个答案:

答案 0 :(得分:0)

<form action="" method="post">
.... existing form data here ....  
    <?php
          // display the re-captcha box if re-captcha is installed:
          if(function_exists('display_recaptcha')){
               display_recaptcha();
          }
      ?>
</form>