PHP IP Logger

Discussion in 'PHP' started by mantodeus, Mar 28, 2008.

  1. #1
    Hello

    Guys can you tell me where I can find working PHP IP LOGGER ? I tried with google but didn't found ?
     
    mantodeus, Mar 28, 2008 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    What exactly your requirement is?
     
    mwasif, Mar 28, 2008 IP
  3. mantodeus

    mantodeus Active Member

    Messages:
    157
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #3
    I need to log IPs of visitors who are trying to access one file ?
     
    mantodeus, Mar 28, 2008 IP
  4. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #4
    You can also make this. In PHP, $_SERVER['REMOTE_ADDR'] gives you the remote user IP address. Save this IP in the database alongwith time and other details.
     
    mwasif, Mar 28, 2008 IP
  5. mantodeus

    mantodeus Active Member

    Messages:
    157
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #5
    I don't have good PHP knowledge so I am looking for some ready scripts :)
     
    mantodeus, Mar 28, 2008 IP
  6. Rory M

    Rory M Peon

    Messages:
    1,020
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Are you looking to write the IPs to a file or to a database?
     
    Rory M, Mar 28, 2008 IP
  7. mantodeus

    mantodeus Active Member

    Messages:
    157
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #7
    It is better to be on file.
     
    mantodeus, Mar 28, 2008 IP
  8. arcticsoft

    arcticsoft Guest

    Messages:
    10
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    PM me and I can write one for you pretty quickly. Wouldn't cost to much.
     
    arcticsoft, Mar 28, 2008 IP
  9. Danltn

    Danltn Well-Known Member

    Messages:
    679
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    120
    #9
    <?php
    file_put_contents('ips.log', $_SERVER['REMOTE_ADDR'] . "\n", FILE_APPEND);
    ?>
     
    Danltn, Mar 29, 2008 IP
    mantodeus likes this.