|
-
Feb 7th, 2002, 02:10 PM
#1
Thread Starter
Lively Member
record ip
does anyone know of a way to record every ip address that visits my page to a file in my directory?
"Sometimes the only way you can feel good about yourself is by making someone else look bad And I'm tired of making other people feel good about themselves"-Homer Simpson
-
Feb 7th, 2002, 06:19 PM
#2
Fanatic Member
There is probably a CGI scripts for that, just search around on google or something
-
Feb 7th, 2002, 06:29 PM
#3
Fanatic Member
if you are hosting your website on your own computer and you are using apache, then this will automatically log all of the ip numbers that goto your site for you
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
-
Feb 27th, 2002, 05:10 PM
#4
Member
If your site is written in PHP, the IP address is $REMOTE_ADDR, which you could log to a file or a MySQL database.
-
Feb 27th, 2002, 06:21 PM
#5
Stuck in the 80s
For CGI: (note that log.txt must exist)
Code:
$ip = $ENV{'REMOTE_ADDR'};
open (LOG,"+<log.txt");
flock (LOG,2); seek (LOG,0,0);
@logfile = <LOG>;
push @logfile, $ip;
seek (LOG,0,0);
print (LOG @logfile);
truncate (LOG,tell(LOG));
close (LOG);
something like that. If your server is SSI enabled, then you can it with exec cgi. Else, you can use an image tag:
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|