ReCAPTCHA Positioning..!

Discussion in 'PHP' started by gasper000, Jul 28, 2009.

  1. #1
    I have added ReCAPTCHA widget to the registration form of my site in order to reduce or prevent spam. It's working fine but I have some problems positioning & resizing it. The ReCAPTCHA widget appears at the top left corner while I want to position & resize it using css styles (ie: style="position:absolute;left:585px;top:1002px;width:46px;height:46px;").

    Do you have any idea how can I do that ?
     
    gasper000, Jul 28, 2009 IP
  2. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #2
    dimitar christoff, Jul 28, 2009 IP
    gasper000 likes this.
  3. Martinoes

    Martinoes Peon

    Messages:
    110
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Try to position elements with id='recaptcha_widget_div', id="recaptcha_area", id="recaptcha_table" in your CSS.

    This is the HTML code of recaptcha:

    <div id="recaptcha_widget_div" class="recaptcha_nothad_incorrect_sol recaptcha_isnot_showing_audio" style="">
    <div id="recaptcha_area">
    <table id="recaptcha_table" class="recaptchatable recaptcha_theme_red">
    <tbody>
    ...
    </table>
    </div>
    </div>
     
    Martinoes, Jul 29, 2009 IP
    gasper000 likes this.
  4. gasper000

    gasper000 Peon

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thank you for your time. I have solved the positioning thing by wrapping the ReCAPTCHA between div tags but still can not resize it. Anyway, I have another problem. I don't know if it's a ReCAPTCHA bug or it's me who's doing something wrong. ReCAPTCHA consists of two words. Everything works fine except if you type only the first word correctly the form proceeds although the second is missing. You can find the codes below:

    header.html
    
    <form method="post" action="somefile.php">  
    	<div class="captcha">
    	<script type="text/javascript">
     var RecaptchaOptions = {
        theme : 'white'
     };
     </script>
    </div>
    <?php
    
    require_once('recaptchalib.php');
    
    // Get a key from http://recaptcha.net/api/getkey
    $publickey = "MyPublicKey";
    
    echo recaptcha_get_html($publickey);
    ?>
    
    Code (markup):
    footer.php
    
    require_once('recaptchalib.php');
    $privatekey = "MyPrivateKey";
    $resp = recaptcha_check_answer ($privatekey,
                                    $_SERVER["REMOTE_ADDR"],
                                    $_POST["recaptcha_challenge_field"],
                                    $_POST["recaptcha_response_field"]);
    
    if (!$resp->is_valid) {
      
      die ('<a>The reCAPTCHA was not entered correctly.</a>');
    	  
    }
    
    Code (markup):
    What do you think ?
     
    gasper000, Aug 1, 2009 IP