Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2010
    Posts
    19
    Thanks
    7
    Thanked 0 Times in 0 Posts

    no Image with Recaptcha

    Thought I had it, I have a html form on my website that validates in a php. I placed the keys in and and put the validation code on my PHP page. But the Captcha image is not showing on my contact-us.html page? Is it because my form is on a html and not php page? Any help would be great.

    Contact-us.html
    Code:
    <div class="contactinnerBox">
                       
    					<form action="FormtoEmail.php" method="post" name="contactForm">
    							<fieldset>
                                
    							    <label for="subject">Subject</label>
                                    <input name="subject" type="text" class="filed1" id="subject" />
    								<label for ="firstname">First Name *</label>
    								<input name="name" type="text" class="filed1" id="name" />
    								<label for "email">Your E-mail *</label>
    								<input name="email" type="text" class="filed1" id="email"  />
    								
    								<label for "comments">Message *</label>
    							  <textarea name="comments"  id="comment"  /></textarea>
                                   <?php
                                    require_once('recaptchalib.php');
                                    $publickey = "6Lfnre4SAAAAAFDLuijsb65eDfVrPl5txJdAi4Ff"; // you got this from                                  the signup page
                                    echo recaptcha_get_html($publickey);
                                    ?>
    
    								<input type="submit" class="button" value="Contact Us"  />
    								
    							</fieldset>
    						</form>
    						
    					</div>
    Form to email form.

    PHP Code:
    <?php
    require_once('recaptchalib.php');
      
    $privatekey "6Lfnre4SAAAAAMc9YxFlt4Ruy5fhIKW0yvo50cRf ";
      
    $resp recaptcha_check_answer ($privatekey,
                                    
    $_SERVER["REMOTE_ADDR"],
                                    
    $_POST["recaptcha_challenge_field"],
                                    
    $_POST["recaptcha_response_field"]);

      if (!
    $resp->is_valid) {
        
    // What happens when the CAPTCHA was entered incorrectly
        
    die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
             
    "(reCAPTCHA said: " $resp->error ")");
      } else {

  • #2
    Regular Coder
    Join Date
    Sep 2002
    Posts
    459
    Thanks
    0
    Thanked 20 Times in 20 Posts
    If Captcha is written in php then the html should be saved as a php file, that's the easiest way. But you can also adapt your htaccess file to except html as php.
    NO Limits!! DHCreationStation.com
    ------------------------------------------------------------
    Broken items wanted for tinkerin'! PostItNow@BrokenEquipment.com
    Global Complaint Dept.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •