Page 1 of 2
IP archiver
Posted: Thu Nov 25, 2004 1:29 pm
by asi0917
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
Posted: Thu Nov 25, 2004 1:37 pm
by John Cartwright
First of all, wrong forum. Second of all, whats your point?
Posted: Thu Nov 25, 2004 1:41 pm
by asi0917
which foru should it be in?
personal pride, last week i didn't know a drop of php
Posted: Thu Nov 25, 2004 1:55 pm
by John Cartwright
Read the forum descriptions..
I would have been it in general or misc
Posted: Thu Nov 25, 2004 1:58 pm
by nigma
Congrats on the script. Was this just a project that you were doing to practice or do you plan on incorporating this script into a site of yours?
Btw, i've moved the post to the general discussion forum.
Posted: Thu Nov 25, 2004 2:10 pm
by asi0917
i just learnt php, fealt inclined to make something, made this
thats all
thnx 4 the move
Posted: Thu Nov 25, 2004 2:22 pm
by redmonkey
Congrats on getting a script up and running, one small problem, it captures the wrong IP address for me.
Posted: Thu Nov 25, 2004 3:22 pm
by qads
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'];
?>
Posted: Thu Nov 25, 2004 5:44 pm
by timvw
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;
}
?>
Posted: Thu Nov 25, 2004 6:36 pm
by John Cartwright
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;
}
?>
Posted: Fri Nov 26, 2004 12:35 pm
by asi0917
wow, who realoded the page 3 hundred billion times?
P.S. thanks for scripts
Posted: Fri Nov 26, 2004 11:13 pm
by asi0917
i need mySQL for those scripts given here right?
my free hosting doesn't have mySQL i think be cause timvw's script doesn't work
anyone know of a free php host with mySQL and a database?
Posted: Sat Nov 27, 2004 4:37 am
by qads
nope, these are just php functions and IF statments to find the real ip, thats all.
Posted: Tue Nov 30, 2004 1:11 pm
by josh
asi0917 wrote:wow, who realoded the page 3 hundred billion times?
me actually
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");
Posted: Wed Dec 01, 2004 5:56 pm
by d3ad1ysp0rk
uhh..
Code: Select all
while ($x < 5) {
file_get_contents($site);
}
so.. it never runs? nice script
I take it that wasnt a copy and paste job.