Go Back   Webmaster Forum > Forum Archives > Cyber-UG Forum Archive
REMOVE the ads below !
 
 
LinkBack Thread Tools
  # 1 (permalink)
Old
Newbie
Posts: 0
Join Date: Feb 2007
iTrader: (0)
Location: Utrecht, Holland
PHP IP-logger - 06-08-2007

Hey all, I've written this IP-logger in PHP and posted it already, but the topic is gone now. So for all who want it, here it is, enjoy!

PHP Code:
<?php

/* ip logger by compufreak7 */

//store the IP in a variable
$TheIP $_SERVER['REMOTE_ADDR'];

//store the visited site in a variable
$RequestedSite $_SERVER['REQUEST_URI'];

//Make the full text for the log, you can modify this
$FullText =  "Users IP: "$TheIP ."\nVisited location: ".$RequestedSite."\n\n";

//Open the file logs.txt on your server, and append it
$theFilefopen("logs.txt""a");

//Write your text in logs.txt ($theFile)
fwrite($theFile$FullText);

//Close down logs.txt
fclose($theFile);
?>


http://i19.tinypic.com/4r2qzc6.gif
^^Get money for clicking links, a fabulous $0.01 per click!^^

gifts
godkillah - Xain
  # 2 (permalink)
Old
Newbie
Posts: 0
Join Date: Jun 2007
iTrader: (0)
Re: PHP IP-logger - 06-08-2007

GREAT JOB. I SUGGEST YOU POSTS IT IN CODEDSCRIPT.COM OR ANY PHP CODES WEBSITES WITH COMPETITION!!!

so you earn prizes!
  # 3 (permalink)
Old
Newbie
Posts: 0
Join Date: Feb 2007
iTrader: (0)
Location: Utrecht, Holland
Re: PHP IP-logger - 06-09-2007

Nah, actually, this kind of code is quite simple. the only thing you need is to know the variables and write them to a .txt file...


http://i19.tinypic.com/4r2qzc6.gif
^^Get money for clicking links, a fabulous $0.01 per click!^^

gifts
godkillah - Xain
  # 4 (permalink)
Old
Junior Geek
Posts: 65
Join Date: Feb 2007
iTrader: (0)
Re: PHP IP-logger - 06-15-2007

you should edit it so it wont adds the same results when people browse.
you can do this by reading the file and matching it for the $FullText
  # 5 (permalink)
Old
Newbie
Posts: 0
Join Date: Feb 2007
iTrader: (0)
Location: Utrecht, Holland
Re: PHP IP-logger - 06-16-2007

Ya, I could do that, but I don't really have time to do that now, and people don't really care unless they get giant pages full of the same IP :P
But.. You go ahead


http://i19.tinypic.com/4r2qzc6.gif
^^Get money for clicking links, a fabulous $0.01 per click!^^

gifts
godkillah - Xain
  # 6 (permalink)
Old
Newbie
Posts: 0
Join Date: May 2007
iTrader: (0)
Re: PHP IP-logger - 06-16-2007

It will not check previous loading and it will safe data every re-loads. After afew days, file will be too long with the too many same informations.
  # 7 (permalink)
Old
Newbie
Posts: 0
Join Date: Feb 2007
iTrader: (0)
Location: Utrecht, Holland
Re: PHP IP-logger - 06-16-2007

That's what I said in my previous post. Please re-read it...


http://i19.tinypic.com/4r2qzc6.gif
^^Get money for clicking links, a fabulous $0.01 per click!^^

gifts
godkillah - Xain
  # 8 (permalink)
Old
Newbie
Posts: 0
Join Date: May 2007
iTrader: (0)
Re: PHP IP-logger - 06-19-2007

You could also just dump all this stuff in a database. At least that's what I did a while back. (But then I got rid of it as IP logging proved to be useless. I've no need to block anyone. )

I guess I like the idea of a database better because the whole storing things as a text file really has me bummed out on so many levels.
  # 9 (permalink)
Old
Newbie
Posts: 0
Join Date: Feb 2007
iTrader: (0)
Location: Utrecht, Holland
Re: PHP IP-logger - 06-19-2007

Yeah I know that. But storing in a database slows a lot of computers down alot, and this was just a simple script :P
If you really want to track & block IP's, see the countries and more, I recommend google analytics (http://www.google.com/analytics)


http://i19.tinypic.com/4r2qzc6.gif
^^Get money for clicking links, a fabulous $0.01 per click!^^

gifts
godkillah - Xain
  # 10 (permalink)
Old
Newbie
Posts: 14
Join Date: May 2007
iTrader: (0)
Re: PHP IP-logger - 06-23-2007

thanks a lot
+1 rep to you compufreak7
 


Thread Tools




vBulletin®, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd. | SEO by vBSEO | Skin developed by vBStyles.com