IP detector script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Paraskass
    Confirmed User
    • May 2002
    • 5829

    #1

    IP detector script

    hey all
    is there a free script i can get for my site which tracks incoming traffic and lists them by domain and IP so that i can avoid hitbots. I use lana and this isnt' a feature right now... So anybody can give me a code that writes to a txt or php file or something... Or whatever...

    thanks
  • NetRodent
    Confirmed User
    • Jan 2002
    • 3985

    #2
    Just use your apache log files.

    Better yet, rewrite your log file directive so that it logs not only the host but the x-forward-for header as well.
    "Every normal man must be tempted, at times, to spit on his hands, hoist the black flag, and begin slitting throats."
    --H.L. Mencken

    Comment

    • Paraskass
      Confirmed User
      • May 2002
      • 5829

      #3
      hummm...

      i forgot to mention i suck with writing and rewriting...
      anything i can download...

      Comment

      • Voodoo
        ♥ ♦ ♣ ♠
        • Sep 2002
        • 10600

        #4
        The Unattainable is Unknown at Zombo.com.

        "I'm selflessly supporting the common good, but only coincidentally looking out for No.1."

        Comment

        • NetRodent
          Confirmed User
          • Jan 2002
          • 3985

          #5
          Originally posted by Paraskass
          hummm...

          i forgot to mention i suck with writing and rewriting...
          anything i can download...
          Something you can download, eh?

          How about the Apache docs. Read up on them and you'll be able to do it.
          "Every normal man must be tempted, at times, to spit on his hands, hoist the black flag, and begin slitting throats."
          --H.L. Mencken

          Comment

          • NastyJack
            Registered User
            • Dec 2002
            • 1291

            #6
            PHP script to capture IP addies:

            <?$log_file = "ip.txt";
            $ip = getenv('REMOTE_ADDR');
            $fp = fopen("$log_file", "a");
            fputs($fp, "$iprn");
            flock($fp, 3);
            fclose($fp);
            PRINT("Your IP Address .....$ip was logged.");?>

            You need to create a file "ip.txt". Set the attributes to 644 and use the <? php {include 'filename' ;} ?> to call the program or you can use it directly in your php page. It will write to the file and display the address on the screen.

            You can also make this work without it writing a file by simply using:

            <?$ip = getenv('REMOTE_ADDR');
            PRINT("Your IP Address .....$ip was logged.");?>

            You can thank Ken at www.workforsex.com for the script!

            Regards
            NastyJack

            Comment

            Working...