Saving IP's?

Discussion in 'PHP' started by Professional Dude, Aug 29, 2009.

  1. #1
    Is possible to save ips of people who visit a specific page such as file.php?

    Is there any code for that?

    Thanks
     
    Professional Dude, Aug 29, 2009 IP
  2. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #2
    in file.php

    at top add this

    <?

    $ip = $_SERVER["REMOTE_ADDR"];

    $open = fopen("filename.txt","w+");

    fwrite($open, $ip);
    fclose($open);
    ?>

    Regards

    Alex
     
    kmap, Aug 29, 2009 IP
  3. johnmacellen

    johnmacellen Member

    Messages:
    316
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    30
    #3
    thanks kmap it worked for me i really appricate you..

    good luck:)
     
    johnmacellen, Aug 29, 2009 IP
  4. almondj

    almondj Peon

    Messages:
    768
    Likes Received:
    11
    Best Answers:
    1
    Trophy Points:
    0
    #4
    Remember to change "filename.txt" to correlate with different pages ;).
     
    almondj, Aug 29, 2009 IP