PHP reCaptcha not showing

1,241 views
Skip to first unread message

Phaedrus

unread,
Oct 19, 2010, 9:29:29 AM10/19/10
to reCAPTCHA
I have been reading and rereading information on this for days now. I
cannot get the reCaptcha to show up using PHP.

My form is stored in question.php and the code is as follows:

<html>
<body>

<div id="main">

<div id="content">

<p><center><b>Send Us A Message</b></center></p>

<p>To send us a message, please fill out the form below.</p>
<script type="text/javascript">
var RecaptchaOptions = {
theme : 'white'
};
</script>
<div align="center"><form method="Post" action="question1.php"
enctype="application/x-www-form-urlencoded">

<label>Name</label>&nbsp;<input type="text" name="Name"
size="25"><br><br>
<label>E-Mail</label>&nbsp;<input type="text" name="Email"
size="25"><br><br>
<label>Message to Contra Mundum II</label><br><textarea
name="MessageBody" rows="10" cols="50">
</textarea><br>

<?php
require_once('recaptchalib.php');
$publickey = "your_public_key"; // you got this from the signup page
echo recaptcha_get_html($publickey);
?>
<br>

<input type="submit" name="SUBMIT" value="SUBMIT"><input type="reset"
name="RESET" value="RESET">
</form></div></div>

</body>
</html>

"your_public_key" has been changed to the key given when I registered
(I just left it out of here for privacy) and the recaptchalib.php is
on the server. The form displays correctly and the "submit" and
"reset" display correctly, but the reCaptcha does not display above
the "submit" and "reset" as it should.

Any ideas?

Phaedrus

Dom Sekotill

unread,
Oct 20, 2010, 10:51:25 AM10/20/10
to reca...@googlegroups.com
If you have a javascript console on your browser could you check for
errors? Google Chrome has a good built-in console.

Dom

brettilizer

unread,
Oct 20, 2010, 8:13:48 PM10/20/10
to reCAPTCHA
I'm currently working on this very thing. Did you save your webpage
as a *.php file instead of a *.html file?

VINOD KOKANE

unread,
Oct 20, 2010, 11:10:19 PM10/20/10
to reca...@googlegroups.com
Hello ,
                                                                                                                                                                                                                                                          i am new boy in this system because i have also work only 2 month but i don't use any thing but you want "CAPTCHA" work then please email me today.........

Thank 

VINOD KOKANE

unread,
Oct 20, 2010, 11:11:06 PM10/20/10
to reca...@googlegroups.com

Spectrum-Nashville.com

unread,
Oct 21, 2010, 5:29:41 PM10/21/10
to reCAPTCHA
Just for the record, I copied your code from above and pasted it
directly into a new php file. I put my public key in it, then posted
it to my web site where recaptchalib.php existed.

It worked perfectly.

DreamWeaver did highlight the <div id="main"> as an unmatched tag,
however.

Good luck.

Ken Allhands

unread,
May 20, 2017, 7:57:49 AM5/20/17
to reCAPTCHA
I fought this for a few hours, then figured out my specific problem.

the recaptcha_get_html() method returns the script source and iframe source as "http", but my site was ssl (https).  I captured the generated output in firebug, hard-coded it into the page in place of the method, then change the sources to "https"...viola...everything shows up.

Hope this helps.
Reply all
Reply to author
Forward
0 new messages