Inputting a Captcha into my registration form

My registration form is such-

<?php if (isset($_POST{'submit1'})){ require_once('captcha/recaptchalib.php'); $privatekey = "6Ldsz_gSAAAAALj_XNx55r6rxM6elj4kzLABiZg6 "; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { echo "FAILED !!!"; } else { echo "ENTERED CORRECTLY !!!"; } } include("config.php"); if(logged_in()) { header("Location: home.php"); exit; } include("notary-top.php"); echo "

Become a Free User

"; message("blank", "error", "You left something blank."); message("pw", "error", "Your passwords didn't match."); message("username_exists", "error", "That username has already been taken."); message("email_exists", "error", "That email has already been taken."); message("email_format", "error", "You didn't provide a valid email."); echo "
First Name
Last Name
Email
Phone Number
Password
Confirm Password
Username
This will be used if you post in the forum
Who referred you to our site? Nobody\n"; $result = mysql_query("SELECT * FROM User ORDER BY user_lname"); while($row = mysql_fetch_assoc($result)) { extract($row); echo "$user_lname, $user_fname\n"; } echo "
Which is true? I am a notary     I want to become a notary
I agree to the Terms & Conditions
"; unset($_SESSION['form']); include("notary-bottom.php"); ?>

My Captcha form code is such-

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

Question is, where do I place the captcha code in the reg form to get to work without syntax errors. Just starting out with the php thing so any advice will sure be appreciated.

I would place it right above this line

[php][/php]

like this

[php] <?php
require_once(‘captcha/recaptchalib.php’);
$publickey = "6Ldsz_gSAAAAAOLjbjsMYQjCATpxwdHJZfT71w2F "; // you got this from the signup page
echo recaptcha_get_html($publickey);
?>
[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service