我不能让Recaptcha出现在Facebox中

时间:2011-07-20 13:07:24

标签: php recaptcha facebox

你可以帮我在Facebox中展示Recaptcha吗?它不会加载图像和我恨它。

这是我的代码:

<?php

require_once('../recaptcha/recaptchalib.php');
$publickey = "APIIII"; // you got this from the signup page

?>
 <script type="text/javascript"> 
$(document).ready(function() {
    $('#inquiry').ajaxForm({
        target: '#error',
        success: function() {
        $('#error').fadeIn('slow');
        }
    });
});
var RecaptchaOptions = {
        theme : 'clean'
    };
</script> 

<div class="top_area">Contact</div>


    <div id="search_area">

    </div>
<div style="overflow-y: hidden;">
<form name="inquiry" id="inquiry" action="ck.php" method="post">
<div id="error"></div>
<table align="center">

<tr>
    <td align="right">Name: </td>
    <td><input type="text" name="name" id="name" value="" /></td>
</tr>


<tr>
    <td align="right">Email: </td>
    <td><input type="text" name="email" id="email" value="" /></td>
</tr>



<tr>
    <td align="right">Company: </td>
    <td><input type="text" name="comp" id="comp" value="" /></td>
</tr>


<tr>
    <td valign="top" align="right"></td>
    <td>
        <?php

              echo recaptcha_get_html($publickey);
            ?>

    </td>
</tr>

<tr>
    <td valign="top"></td>
    <td>
        <input type="submit" id="submit" name="submit" value="Send"  />
    </td>
</tr>
</table>
</form>
</div>`

谢谢你们,

Xxxxxxxxxxxxxxxxxxxxxxx

1 个答案:

答案 0 :(得分:0)

您必须使用recaptcha AJAX API http://code.google.com/apis/recaptcha/docs/display.html#AJAX

在您的页面中包含AJAX API脚本(包含页面而不是重新获取的页面)然后调用Recaptcha对象的create方法来创建新的验证码。