Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   Ip logging script help (http://www.go4expert.com/forums/ip-logging-script-help-t19581/)

netpumber 29Sep2009 01:59

Ip logging script help
Hallo guyz!! Im new here.. and im new in php coding.. So...

I have this simple script that logs ips that visit my site in a local file.

PHP Code:

$date date("d-m-y / H:i:s");
$all $dae " - " $ip " - " $page "<br />";
$fopen fopen("ips.txt""a");

Now i want to add something more in this log file. I want to add the result of this link:


where x.x.x.x the ip that visits my site. Is it possible ? If yes.. please help me...

Thanks ..!!

shabbir 29Sep2009 11:31

Re: Ip logging script help
If you want the content of that page then you can use the fsockopen to get the content of the url but if you want them parse them use API or else too many query and they may ban your ip

netpumber 29Sep2009 13:49

Re: Ip logging script help
Ok... Thanks...for your answer..

Lets say that it has logs some ips...Can i make the script to send the results in my email account ?

mayz 5Oct2009 05:51

Re: Ip logging script help
Try the IP logging script at
If you want it to email the IP to your email address add the following code below the script:
$to = "info@youremail.com";
$body = "Hi,\n\nA new IP addresss is " .$user_ip ;
if (mail($to, $subject, $body)) {
echo("<p>IP logged</p>");
} else {

All times are GMT +5.5. The time now is 20:56.