#1
  1. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,095
    Rep Power
    220

    How long do bots, fake spider and unhuman-bullshet visitors stay on the page


    Hi;

    Using this periodic updater, can I guarantee my database updates are REAL human?
    PHP Code:
    <script>
    $( document ).ready(function() {
      setTimeout( function()
        { 
          var email = '<?php echo $email;?>';
           $( "#pass_to_ontraport" ).load( "<?php echo base_url('pass_to_ontraport/index');?>", { email: email} );  
          }  , 5000 );
           
          }); 


    function update() {
      $.get("<?php echo base_url('update_plc1_views');?>", function(data) {
        $("#submit_results").html(data);
        window.setTimeout(update, 60000);
      });
    }

    $(document).ready(function() {
      // run the first time; all subsequent calls will take care of themselves
      setTimeout(update, 60000);
      
    });
     </script>
    And here is the updater page
    PHP Code:
    <?php
    defined
    ('BASEPATH') OR exit('No direct script access allowed');

    class 
    Update_plc1_views extends CI_Controller {

        public 
    $contact_details;
        public function 
    index()
            {
                
    $this->contact_details $this->db->get_where('sequence_members', array('email' => $_SESSION['email']));
                if(
    $this->contact_details->num_rows()==1)
                    {
                        
    $this->update_plc1_visits();
                        
    $this->update_view_length();
                    }    
            }        
        private function 
    update_plc1_visits()
            {
                
    //Update PLC 1 visit
                
    $plc_1_visited $this->contact_details->result_array()[0]['plc_1_visited'];
                
    $plc_1_visited $plc_1_visited+1;
                
    $data = array('plc_1_visited' => $plc_1_visited);
                
    $this->db->where('email'$_SESSION['email']);
                
    $this->db->update('sequence_members'$data); 

                
    /*IF BEEN TO THIS PAGE MORE THNA ONCE AND plc_1_max_view_time > 3,     
                        ADD TO THTB EVERGREEN SEQUENCE AND THAT PASSES THEM TO THE CAMPAIGN
                */
            
    }
        private function 
    update_view_length()
            {
                
    //Get maximum view time of PLC 1
                        
    $plc_1_max_view_time $this->contact_details->result_array()[0]['plc_1_max_view_time'];

                        
    //Get this time view time of PLC 1
                        
    $plc_1_view_time $this->contact_details->result_array()[0]['plc_1_view_time'];

                        
    //Update this time view time of PLC 1
                        
    $plc_1_view_time $plc_1_view_time+1;    
                        
    $data = array('plc_1_view_time' => $plc_1_view_time);
                        
    $this->db->where('email'$_SESSION['email']);
                        
    $this->db->update('sequence_members'$data); 

                        
    //If this time watched more than ever, increase max watch time
                        
    if($plc_1_max_view_time $plc_1_view_time)
                            {
                                
    $plc_1_max_view_time $plc_1_max_view_time+1;    
                                
    $data = array('plc_1_max_view_time' => $plc_1_max_view_time);
                                
    $this->db->where('email'$_SESSION['email']);
                                
    $this->db->update('sequence_members'$data); 
                            }
            }        
    }
    Last edited by English Breakfast Tea; June 29th, 2017 at 05:15 AM.
  2. #2
  3. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,095
    Rep Power
    220
    I'd appreciate some comments. Thanks
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2017
    Posts
    8
    Rep Power
    0
    Absolutely no warranty that these asses will not register.
  6. #4
  7. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,095
    Rep Power
    220
    Not sure what you mean... what I see here, it registers well (and it's very accurate), works well with the api too.

    I wait for Requnix or Kicken's comment to discard this solution.
  8. #5
  9. Wiser? Not exactly.
    Devshed God 2nd Plane (6000 - 6499 posts)

    Join Date
    May 2001
    Location
    Bonita Springs, FL
    Posts
    6,026
    Rep Power
    4101
    Dumb bots probably wouldn't execute your script at all so the timeout length is irrelevant. Smarter bots might run it to completion making it equally irrelevant. Since I've never explored the bot universe to see what exists and how they function I have no idea what's level of scripting support is used. I would imagine that bots which support scripting probably only do so briefly before moving on so a long timeout might work. They might also just ignore the duration and run the function immediately.

    I used a JS trick years ago to prevent spam on my guestbook and it seemed to work fairly well. Some stuff occasionally made it through but it stopped probably 90% of it, making the rest easy to deal with by hand.

    Ultimately if it seems to work for you and it doesn't cause problems with real users then go ahead and use it.
    Recycle your old CD's



    If I helped you out, show some love with some reputation, or tip with Bitcoins to 1N645HfYf63UbcvxajLKiSKpYHAq2Zxud
  10. #6
  11. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,544
    Rep Power
    4542
    I wait for Requnix or Kicken's comment to discard this solution.
    OK, that's up to you, but why advertise only certain responders, other than to discourage anyone else from trying to answer?
    ======
    Doug G
    ======
    I've never been able to appreciate the sublime arrogance of folks who feel they were put on earth just to save other folks from themselves .." - Donald Hamilton
  12. #7
  13. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,095
    Rep Power
    220
    Originally Posted by Doug G
    OK, that's up to you, but why advertise only certain responders, other than to discourage anyone else from trying to answer?
    Because those 2 are superheroes
  14. #8
  15. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Caro, Michigan
    Posts
    14,735
    Rep Power
    4536
    Originally Posted by Doug G
    OK, that's up to you, but why advertise only certain responders, other than to discourage anyone else from trying to answer?
    Keeps the peasants like you and I away, Doug.
    -- Cigars, whiskey and wild, wild women. --
  16. #9
  17. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,544
    Rep Power
    4542
    Originally Posted by Sepodati
    Keeps the peasants like you and I away, Doug.
    Yeah, I'm more inclined to cigars, whisky, and wild wild women (well, I used to be before I became ancient anyway)
    ======
    Doug G
    ======
    I've never been able to appreciate the sublime arrogance of folks who feel they were put on earth just to save other folks from themselves .." - Donald Hamilton
  18. #10
  19. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2016
    Location
    Lakewood, WA
    Posts
    192
    Rep Power
    17
    Originally Posted by Doug G
    Yeah, I'm more inclined to cigars, whisky, and wild wild women (well, I used to be before I became ancient anyway)
    Do you secretly fantasize about being The Most Interesting Man? Of course you can dream, but I currently hold that title.
  20. #11
  21. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,544
    Rep Power
    4542
    Do you secretly fantasize about being The Most Interesting Man? Of course you can dream, but I currently hold that title.
    Nah, I'm to close to the top of the Least Interesting Man list
    ======
    Doug G
    ======
    I've never been able to appreciate the sublime arrogance of folks who feel they were put on earth just to save other folks from themselves .." - Donald Hamilton
  22. #12
  23. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,095
    Rep Power
    220
    Originally Posted by Sepodati
    Keeps the peasants like you and I away, Doug.
    Hey! Didn't mean to hurt your feelings! I am sure you're great as well. Here's to Devshed
  24. #13
  25. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2016
    Location
    Lakewood, WA
    Posts
    192
    Rep Power
    17
    Originally Posted by English Breakfast Tea
    Hey! Didn't mean to hurt your feelings! I am sure you're great as well. Here's to Devshed
    Is that like a "participation award"?

IMN logo majestic logo threadwatch logo seochat tools logo