Results 1 to 10 of 10

Thread: A Question About Captcha Code

  1. #1
    Join Date
    Sep 2013
    Location
    Antalya - Turkey
    Posts
    37
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Question A Question About Captcha Code

    Hello everybody;

    I have a problem with captcha code...
    If i add this template to directory,the captcha code isn't shown...
    But on the original template going everything fine...

    This is the orginal template: http://html.creaws.com/kiddy/contact-us.html
    This is the same template which i want to use: http://bbb.antalyabalikcilik.com.tr/contact-us.html

    Please help me,what is wrong ?

    Thank you for your help in advance...

  2. #2
    Join Date
    Jan 2009
    Location
    NH
    Posts
    675
    Thanks
    98
    Thanked 26 Times in 26 Posts

    Default

    the only difference in your code is in the working page you have this
    <!-- Mirrored from html.creaws.com/kiddy/contact-us.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 09 Mar 2016 12:02:26 GMT -->

    https://www.diffnow.com/ is a good page to input to see differences

  3. The Following User Says Thank You to mlegg For This Useful Post:

    volkantr19 (03-12-2016)

  4. #3
    Join Date
    Sep 2013
    Location
    Antalya - Turkey
    Posts
    37
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    Thanks for answer...
    What should i do for working captcha code on my contact page ?
    Which code i must add or delete ?

  5. #4
    Join Date
    Jan 2009
    Location
    NH
    Posts
    675
    Thanks
    98
    Thanked 26 Times in 26 Posts

    Default

    Do you have the http://html.creaws.com/kiddy/php/contacts-process.php uploaded to your server?

  6. #5
    Join Date
    Jan 2009
    Location
    NH
    Posts
    675
    Thanks
    98
    Thanked 26 Times in 26 Posts

    Default

    I just noticed you have an extra </li> end tag

    </li><div class="header_logo_part with_border" role="banner">

    there are no alt tags in the img html either

    validate your html code for errors at
    https://validator.w3.org/

    https://html5.validator.nu/
    Last edited by mlegg; 03-13-2016 at 01:13 AM.

  7. #6
    Join Date
    Sep 2013
    Location
    Antalya - Turkey
    Posts
    37
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by mlegg View Post
    Do you have the http://html.creaws.com/kiddy/php/contacts-process.php uploaded to your server?

    No,i didn't upload this php file to the server?

    This php file isn't related with captcha code...
    The problem is: captcha code isn't shown on the page...

  8. #7
    Join Date
    Sep 2013
    Location
    Antalya - Turkey
    Posts
    37
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    I tried everthing but still same problem...

    When the webpage loads no captcha image shows up, just an image placeholder...

    Still thinking about this problem...

  9. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    These are two different servers right? Anyways, the captcha image (missing on the bad page - 404 not found, and obviously there on the working page) is generated by PHP. So we really cannot see the problem by looking at the HTML/css/javascript involved. Now, you could try linking to the capcha image on the good server, if that's allowed and isn't blocked, and if it would work as a capcha (might not, because for a captcha to work, the page it's on has to 'know' the right answer). Otherwise you would have to make sure the server where you are having the problem has both PHP support and the files and libraries required to generate and use the capcha image.

    The 'bad' page is also missing a number of other resources available on the good page. However, since this most likely is a server side issue, fixing those might not help. Here they are though (can't hurt to fix them):


    http://bbb.antalyabalikcilik.com.tr/js/jquery.js Failed to load resource: the server responded with a status of 404 (Not Found)send @ jquery.js:5
    http://bbb.antalyabalikcilik.com.tr/tuner/tuner/images/switcher_img/menu-01.png Failed to load resource: the server responded with a status of 404 (Not Found)
    http://bbb.antalyabalikcilik.com.tr/tuner/tuner/images/switcher_img/menu-02.png Failed to load resource: the server responded with a status of 404 (Not Found)
    http://bbb.antalyabalikcilik.com.tr/tuner/tuner/images/switcher_img/menu-03.png Failed to load resource: the server responded with a status of 404 (Not Found)
    http://bbb.antalyabalikcilik.com.tr/tuner/tuner/images/switcher_img/theme-style-02.png Failed to load resource: the server responded with a status of 404 (Not Found)
    http://bbb.antalyabalikcilik.com.tr/tuner/tuner/images/switcher_img/theme-style-01.png Failed to load resource: the server responded with a status of 404 (Not Found)
    Last edited by jscheuer1; 03-14-2016 at 08:47 PM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. #9
    Join Date
    Sep 2013
    Location
    Antalya - Turkey
    Posts
    37
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    Thank you for your answer Mr. John...
    I created new php file for the captcha code....Finally its working (shows up)...But i still don't know how !!!
    New problem is contact form don't send any message to my email....I know,there is some wrong code...

    You can try too,form dont send message...
    http://bbb.antalyabalikcilik.com.tr/contact-us.html

    Please check this codes...Is there any mistake ????


    html code:

    Code:
    <!-- contact form -->
                            <div class='grid_col grid_col_8'>
                                <div class='ce clearfix'>
                                    <h3 class="ce_title">Drop us a line</h3>
                                    <div>
                                        <div role="form" class="cf" id="cf-f16-p10-o1" lang="en-US" dir="ltr">
                                            <div class="screen-reader-response"></div>
                                            <form action="php/contacts-process.php" method="post" class="cf-form contact-form" novalidate="novalidate">
                                                <p>Name*
                                                    <br />
                                                    <span class="cf-form-control-wrap your-name"><input type="text" name="name" value="" size="107" class="cf-form-control cf-text cf-validates-as-required" aria-required="true" aria-invalid="false" /></span> </p>
                                                <p>Email*
                                                    <br />
                                                    <span class="cf-form-control-wrap your-email"><input type="email" name="email" value="" size="107" class="cf-form-control cf-text cf-email cf-validates-as-required cf-validates-as-email" aria-required="true" aria-invalid="false" /></span> </p>
                                                <p>Message
                                                    <br />
                                                    <span class="cf-form-control-wrap your-message"><textarea name="message" cols="107" rows="8" class="cf-form-control cf-textarea" aria-invalid="false"></textarea></span> </p>
                                                <p>
                                                    <span class="captcha-wrapper">
                                                        <iframe src="php/capcha.php" class="capcha-frame" name="capcha_image_frame"></iframe>
                                                        <input class="verify" type="text" id="verify" name="verify" />
                                                    </span>
                                                    <input type="submit" value="Send" class="cf-form-control cf-submit" />
                                                </p>
                                                <div class="cws_msg_box error-box clearfix">
                                                    <div class="icon_section"><i class="fa fa-exclamation"></i></div>
                                                    <div class="content_section">
                                                        <div class="msg_box_title">Error box</div>
                                                        <div class="msg_box_text"></div>
                                                    </div>
                                                </div>
                                            </form>
                                            <div class="email_server_responce"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!-- / conatct form -->

    js code:

    Code:
    /* contact form */
    if (jQuery(".contact-form").length) {
      /**/
      /* contact form */
      /**/
    
      /* validate the contact form fields */      
      jQuery(".contact-form").each(function(){
    
        jQuery(this).validate(  /*feedback-form*/{
            onkeyup: false,
            onfocusout: false,
            errorElement: 'p',
            errorLabelContainer: jQuery(this).find('.msg_box_text'),
            rules:
            {
              name:
              {
                required: true
              },
              email:
              {
                required: true,
                email: true
              },
              message:
              {
                required: true
              },
              verify: {
              	required: true,
              	remote: {
                  url: 'php/capcha.php',
                  type: "post",
                  data:
                  {
                      code: function()
                      {	
                          return jQuery('.verify').val();
                      }
                  }
                }
    	      }
            },
            messages:
            {
              name:
              {
                required: 'Please enter your name',
              },
              email:
              {
                required: 'Please enter your email address',
                email: 'Please enter a VALID email address'
              },
              message:
              {
                required: 'Please enter your message'
              },
              verify: {
              	required: 'Please enter Captcha',
              	remote: "Please enter a VALID Captcha"
    	      }
            },
            invalidHandler: function()
            {
              jQuery(this).find(".cws_msg_box.error-box").slideDown('fast');
              jQuery("#feedback-form-success").slideUp('fast');
    
            },
            submitHandler: function(form)
            {   
              jQuery(form).find(".cws_msg_box.error-box").slideUp('fast'); 
              var $form = jQuery(form).ajaxSubmit();
              submit_handler($form, jQuery(form).parent().children(".email_server_responce") );
            }
          });
        })
    
      /* Ajax, Server response */ 
      var submit_handler =  function (form, wrapper){
    
        var $wrapper = jQuery(wrapper); //this class should be set in HTML code
        
        $wrapper.css("display","block");
        var data = {
          action: "email_server_responce",
          values: jQuery(form).serialize()
        };
        //send data to server
        jQuery.post("php/contacts-process.php", data, function(s_response) {
          s_response = jQuery.parseJSON(s_response);
          if(s_response.info == 'success'){
            $wrapper.addClass("message message-success").append('<div class="cws_msg_box success-box clearfix"><div class="icon_section"><i class="fa fa-thumbs-up"></i></div><div class="content_section"><div class="msg_box_title">Success!</div><div class="msg_box_text">Your message was successfully delivered.</div></div></div>');
            $wrapper.delay(5000).hide(500, function(){
              jQuery(this).removeClass("message message-success").text("").fadeIn(500);
              $wrapper.css("display","none");
            });
            jQuery(form)[0].reset(); 
          } else { 
            $wrapper.addClass("cws_msg_box error-box clearfix").append("<div class='icon_section'><i class='fa fa-exclamation'></i></div><div class='content_section'><div class='msg_box_title'>Server fail!</div><div class='msg_box_text'><p> Please try again later!</p></div></div>");
            $wrapper.delay(5000).hide(500, function(){
              jQuery(this).removeClass("cws_msg_box error-box clearfix").text("").fadeIn(500);
              $wrapper.css("display","none");
            });
          }
        });
      return false;
      }
    }
    
    /**/

    php code:

    Code:
    <?php
    if(!session_id()) {
    	session_start();
    }
    error_reporting(0);
    
    if (isset($_REQUEST['action'])) {
        if ($_REQUEST['action'] == "php/contacts-process.php") {
            $ourMail = "volkan19@hotmail.com";
            $pre_messagebody_info = "";
            $errors = array();
            $data = array();
            parse_str($_REQUEST['values'], $data);
    
            $result = array(
                "is_errors" => 0,
                "info" => ""
            );
            if (!empty($errors)) {
                $result['is_errors'] = 1;
                $result['info'] = $errors;
                echo json_encode($result);
                exit;
            }
    }	
    }
    }
    ?>

  11. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Since you have the image working, that tells us the server has PHP at least. So, either there is an error or overzealous validation with either the javascript or the PHP. One thing that looks fishy to me right off in the PHP is this line:

    PHP Code:
    if (isset($_REQUEST['action'])) 
    In this case 'action' is a property of the form tag, neither that property nor its value is sent when the form is submitted. At least not as part of the $_REQUEST object. So that would always be false. That's probably it. A property/value pair of a form element from within the form should be used. The console did not detect any javascript error, so - unless the javascript is being overzealous, I would think fixing the PHP should take care of it. I can guarantee that action will never be set though, not with this setup, so as I say, you would need to go after something else on the PHP side for it to ever get past that first test there.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. Code for Captcha
    By Elbee in forum Other
    Replies: 2
    Last Post: 11-26-2014, 04:18 PM
  2. Replies: 13
    Last Post: 02-18-2011, 05:51 AM
  3. Captcha Code/Script Required
    By andysam in forum Looking for such a script or service
    Replies: 3
    Last Post: 04-21-2010, 10:33 PM
  4. breaking news xrumer blast breaking captcha code
    By GefsIllishemi in forum The lounge
    Replies: 0
    Last Post: 01-22-2010, 06:13 PM
  5. Replies: 5
    Last Post: 10-11-2007, 01:29 PM

Bookmarks

Posting Permissions

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