IP archiver
Moderator: General Moderators
- asi0917
- Forum Commoner
- Posts: 41
- Joined: Thu Nov 25, 2004 10:37 am
- Location: Shoreline, Washington
- Contact:
IP archiver
very crude but gets the job done
http://hosting.mixcat.com/asi0917/ips.php
saves ips to
http://hosting.mixcat.com/asi0917/test.txt
don't worry, im not saving any, for show off purposes only
http://hosting.mixcat.com/asi0917/ips.php
saves ips to
http://hosting.mixcat.com/asi0917/test.txt
don't worry, im not saving any, for show off purposes only
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
yup, its grabing my ISP's proxy server, try this.
Code: Select all
<?php
$ip = (empty($_SERVER['HTTP_X_FORWARDED_FOR'])) ? $_SERVER['REMOTE_ADDR'] : $_SERVER['HTTP_X_FORWARDED_FOR'];
?>from the php manual 
Code: Select all
<?php
function getIP() {
$ip;
if (getenv("HTTP_CLIENT_IP")) $ip = getenv("HTTP_CLIENT_IP");
else if(getenv("HTTP_X_FORWARDED_FOR)) $ip = getenv("HTTP_X_FORWARDED_FOR");
else if(getenv("REMOTE_ADDR")) $ip = getenv("REMOTE_ADDR");
else $ip = "UNKNOWN";
return $ip;
}
?>- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
without the parse error ... 
Code: Select all
<?php
function getIP() {
$ip;
if (getenv("HTTP_CLIENT_IP")) $ip = getenv("HTTP_CLIENT_IP");
else if(getenv("HTTP_X_FORWARDED_FOR")) $ip = getenv("HTTP_X_FORWARDED_FOR");
else if(getenv("REMOTE_ADDR")) $ip = getenv("REMOTE_ADDR");
else $ip = "UNKNOWN";
return $ip;
}
?>me actuallyasi0917 wrote:wow, who realoded the page 3 hundred billion times?
I was bored...
you might wanna make it so that if some one reloads it 10 times in less then 10 seconds they get banned from your site or something, this prevents you from getting 300 MB log files to go through when an idiot like me decides he wants to flood you for no apparent reason.
Code: Select all
function flood($site) {
$x=10;
while ($x < 5) {
file_get_contents($site);
}
}
flood ("http://hosting.mixcat.com/asi0917/ips.php");-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
uhh..
so.. it never runs? nice script 
I take it that wasnt a copy and paste job.
Code: Select all
while ($x < 5) {
file_get_contents($site);
}I take it that wasnt a copy and paste job.