How do I log Ip's coming on to my site???
alex126
How do I log Ip's coming on to my site???
alex126
Originally Posted by Mentor
that should all be in your raw access logs anyway, but if u have php a logger system would be pretty simple, just get the ip, and append a flat file with what ever one it detects every page activation
oky dockey. Hotscripts it is
=.=
ok ok, heres a basic script to do it, just ads each ip to a new line, thats all it does thogh so if u wanted other stats with it youd have to ask
PHP Code:<?php
//file (chmod it to 777)
$file = "ips.txt";
// get ip
$userip = $_SERVER['REMOTE_ADDR'];
// write ip data to file
$fp = fopen($file, "a") or die( "Error" );
fputs($fp, "$userip \n");e
fclose($fp);
?>
Originally Posted by Mentor
=.=
ok ok, heres a basic script to do it, just ads each ip to a new line, thats all it does thogh so if u wanted other stats with it youd have to ask
PHP Code:<?php
//file (chmod it to 777)
$file = "ips.txt";
// get ip
$userip = $_SERVER['REMOTE_ADDR'];
// write ip data to file
$fp = fopen($file, "a") or die( "Error" );
fputs($fp, "$userip \n");e
fclose($fp);
?>
So do I put this on the page of my site???
Originally Posted by Mentor
yup, as long as your host suppoorts php, and the page type is php it will work.
athogh rember to create the file ips.txt and chmod it to 777
Dam It wont work I keep on getting interneal server error and stuff
Edit: its working now
+rep
Want to hide these adverts? Register an account for free!