SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 28 of 28
  1. #26
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,276
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    Robots.txt is your friend... Good Bots follow it.

  2. #27
    SitePoint Member
    Join Date
    Sep 2009
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile

    Hi,

    One way that I check for bots is:

    Code PHP:
    $UI_Agent = $_SERVER['HTTP_USER_AGENT'];
    if(eregi("googlebot", $UI_Agent)) {
       // you have found Google's bot!
       ...
    }

    HTH,
    Bud
    Owner/Webmaster/... - Manz Web Designs, LLC

  3. #28
    SitePoint Guru
    Join Date
    Jun 2006
    Posts
    638
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    321web the simple pseudo-code is this:

    PHP Code:
    <?php
    session_start
    ();
    // Someone submited the form, after 10 sec of first get
    if ((isPost('btnSubmit')) && (isset($_SESSION['form'][$PHP_SELF]) && $_SESSION['form'][$PHP_SELF] < time() - 10)) {
      unset(
    $_SESSION['form'][$PHP_SELF]);
      
    // save / validate form
      
    if (save()) {
        
    setMessage('form saved');
        
    // 302 
        
    header('Location: /');
        exit;
      }else{
        
    setError('form has errors');
        
    // They can fix the form much faster than they can fill it (say 1 -2 sec?)
        
    $_SESSION['form'][$PHP_SELF] = time() - 9;
      }
    } else 
    // Someone just loaded the page, load defaults
    {
      
    $_SESSION['form'][$PHP_SELF] = time();
    }
    ?>
    html
    ...
    -- POST form --
    ...


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
  •