Google Msn Yahoo Bot Last Visit Date Help Me

Discussion in 'PHP' started by realturk, May 23, 2010.

  1. #1
    Google Msn Yahoo Bot Last Visit Date;

    i want to one web site google msn yahoo bot last visit date learning... please help me

    samples code ?

    thanx dp
     
    realturk, May 23, 2010 IP
  2. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #2
    You can manipulate the $_SERVER['HTTP_USER_AGENT'] variable to check for the bots...and then log the time/date when this has occured - for example to a file...follow this example (it will update a file named google_last_visit.txt overwriting it with the time/date of the google bot visit - which would give the last visit).

    <?php
    if (stristr($_SERVER['HTTP_USER_AGENT'], 'google')){
    file_put_contents('google_last_visit.txt', date("F j, Y, g:i a"));
    }
    ?>
    PHP:
     
    danx10, May 23, 2010 IP
  3. realturk

    realturk Active Member

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    93
    #3
    Hey danx10 thank you very much, I do not want this...

    i want to please check image.

    [​IMG]

    understand me ? help me please
     
    realturk, May 23, 2010 IP
  4. kaleshwar

    kaleshwar Peon

    Messages:
    43
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    impossible unless its your own site, in which case danx10 has given you the answer, you cant just get the visit date of any site.
     
    kaleshwar, May 27, 2010 IP
  5. realturk

    realturk Active Member

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    93
    #5
    thanx I made myself a small boat with php... bye
     
    realturk, Jun 5, 2010 IP