Hi, I'm trying to incorporate reCAPTCHA into a blog project I set
aside for myself to do over summer break so I don't forget everything
I know, and it just WILL not show when I add the code.
Here is a snippet of my code (If you'd like the full source, let me
know)
comment.php:
<?php
@session_start();
function editForm() {
include 'lib/functions.php';
?>
<form action="comment" method="post" id="edit-form" class="comment-
form">
<?php if ($_SESSION['loggedIn']) { ?>
<div class="user-info">
<img src="<?php echo imageLocation('img/users/',
$_SESSION['user']['id'], 'jpg', 'img/users/default.jpg'); ?>"
alt="Image of <?php echo $_SESSION['user']['username']; ?>" />
<h1 class="poster"><?php echo $_SESSION['user']['username']; ?></
h1>
</div>
<input type="hidden" id="name" name="name" value="<?php echo
$_SESSION['user']['username']; ?>" />
<input type="hidden" id="email" name="email" value="<?php echo
$_SESSION['user']['email']; ?>" />
<input type="hidden" id="homepage" name="homepage" value="<?php
echo $_SESSION['user']['homepage']; ?>" />
<?php } else { ?>
<ul>
<li>
<label for="name">Name:</label>
<input type="text" id="name" name="name" />
</li>
<li>
<label for="email">E-mail:</label>
<input type="text" id="email" name="email" />
</li>
<li>
<label for="site">Homepage:</label>
<input type="text" id="homepage" name="homepage" />
</li>
<li>
<?php
require_once('lib/recaptchalib.php');
define('PUBLIC_KEY', '6Lc84LsSAAAAAFWY3HLkgXMHkmgPQbOUxV4XEtbd');
$error = null;
echo recaptcha_get_html(PUBLIC_KEY, $error);
?>
</li>
</ul>
<?php } ?>
When I view the code with Firebug (since this form is grabbed via
AJAX) it is eliminating the call to the Javascript on Google's server
and leaving only the noscript. I have successfully managed to get the
reCAPTCHA showing on a test page, and by viewing the former without
the AJAX retrieval.
My test page:
http://ikari7789.no-ip.org/blog/test.php
Example page with reCAPTCHA:
http://ikari7789.no-ip.org/blog/post/Test-Post-2
Form without AJAX:
http://ikari7789.no-ip.org/blog/comment.php?newComment=1
The form that is supposed to have reCAPTCHA is displayed when you
click on the "Add Comment" link.
Thanks for any help. I've searched around and I just can't find
anything relating to this problem.