Thread: [TUT] Track users/bots IPs & Referers

Results 1 to 8 of 8
  1. #1 [TUT] Track users/bots IPs & Referers 
    Registered Member Innovator's Avatar
    Join Date
    Jul 2011
    Posts
    270
    Thanks given
    63
    Thanks received
    21
    Rep Power
    23
    Difficulty: 1/10
    Assumed Knowledge: Copy & Paste / Min. HTML & PHP Knowledge
    Recommended Programs: Notepad++, FileZilla


    Code:
    <?php
    //By Unlucky @ Rune-Server (alessandroricciardi.com)
    $agent = $_SERVER['HTTP_USER_AGENT']; //this tells you if they are using Windows 7, Mac, etc
    $ip = $_SERVER['REMOTE_ADDR']; //IP address
    $time = date('l jS \of F Y g:i:s A'); //Time, date, EG: "Wednesday 3rd of August 2011 11:31:47 AM"
    $referer = getenv ('HTTP_REFERER'); //Tells you what site they came from (if it was linked)
    $fp = fopen('other/iplog.htm', 'a'); // editing file
    
     if ($ip != 'REPLACEIP') { // add your IP in the REPLACEIP area.
    // this is so it does not log your visits every time.
    
    fwrite($fp, '<strong>Referer</strong>: '.$referer.' <strong>IP</strong>: <a href="http://whois.domaintools.com/' .$ip. '">' .$ip. '</a> <strong>Date</strong>: ' .$time. ' <br><strong>Agent</strong>: ' .$agent. '<br><br>');
    fclose($fp);
    //writing files
     }
    ?>
    Name this file anything.php (iplogger, ipgrabber, etc would be efficient)

    Save this in a folder, name it "other". You can rename it to something else but change it in the codes I've given you.

    Code:
    <?php
    	include( "other/anything.php" );
    ?>
    Add this in EVERY PAGE you want to have logged. Remember that the page must be named .php

    For example, www.test.com/hey.php

    - - - -

    Yes there is already a tutorial on this but it is very over complicated. This is simple and takes about 2 minutes.

    There are better/cleaner ways of doing this but I wrote this at least a year ago and decided to release on here from my website. Very useful at times.

    - - - -

    Any questions or problems let me know here.
    I will be posting a tutorial on how to make a site so that you only need to edit one file to effect the rest of the web pages hosted. Instead of editing every other page.
    Reply With Quote  
     

  2. Thankful user:


  3. #2  
    HEAD GFX DESIGNER

    Rusko's Avatar
    Join Date
    Aug 2010
    Posts
    3,316
    Thanks given
    645
    Thanks received
    1,199
    Rep Power
    5000
    Thanks.
    Attached image
    Reply With Quote  
     

  4. Thankful user:


  5. #3  
    Registered Member Innovator's Avatar
    Join Date
    Jul 2011
    Posts
    270
    Thanks given
    63
    Thanks received
    21
    Rep Power
    23
    Quote Originally Posted by Mr. Canadian View Post
    Thanks.
    No problem,

    Let me know if you have any questions/problems.
    Reply With Quote  
     

  6. #4  
    Renown Programmer

    Nikki's Avatar
    Join Date
    Aug 2008
    Posts
    3,992
    Thanks given
    553
    Thanks received
    1,078
    Rep Power
    5000
    There's also something called access logs....
    Please don't add/pm me asking for RSPS help!

    Links:
    - Pastebin
    - Sleeksnap

    Reply With Quote  
     

  7. Thankful user:


  8. #5  
    DystopiaPS

    Bells's Avatar
    Join Date
    Dec 2008
    Age
    27
    Posts
    3,788
    Thanks given
    600
    Thanks received
    1,449
    Rep Power
    4098
    Quote Originally Posted by Nikki View Post
    There's also something called access logs....
    This.

    OT: Good job I suppose.
    Reply With Quote  
     

  9. #6  
    Registered Member Innovator's Avatar
    Join Date
    Jul 2011
    Posts
    270
    Thanks given
    63
    Thanks received
    21
    Rep Power
    23
    This way is more fun.
    Reply With Quote  
     

  10. #7  
    Registered Member
    Join Date
    Dec 2011
    Posts
    10
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Even though it hurts me to say, Nikki is right. Access logs are way better than this... but good job anyway.
    Reply With Quote  
     

  11. #8  
    Registered Member
    Whired's Avatar
    Join Date
    Aug 2007
    Posts
    2,126
    Thanks given
    238
    Thanks received
    500
    Rep Power
    822
    Why track details that bots have to spoof..IP is pretty much the only relevant one
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Lyrics for the track
    By Bruno in forum Literature & Language Arts
    Replies: 8
    Last Post: 11-25-2010, 08:33 PM
  2. My first milkytracker track
    By Harha in forum Music
    Replies: 0
    Last Post: 05-24-2008, 02:26 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •