Home »
Imported messages »
comp.lang.php »
tracking IP's
Re: tracking IP's [message #182066 is a reply to message #182065] |
Tue, 02 July 2013 02:03 |
Doug Miller
Messages: 171 Registered: August 2011
Karma:
|
Senior Member |
|
|
richard <noreply(at)example(dot)com> wrote in news:h54uiific0f9$(dot)k8umottu5xrj(dot)dlg(at)40tude(dot)net:
> I want a simple script that will keep track of IP's in a mysql table.
>
> This script works. But puts the IP in a text file.
> It's ok, but doesn't seem to detect any other IP but mine.
No big surprise there -- no reason to think that there are any hits from any other IP address
but yours.
> I know this because my hit counter shows there has been new visitors.
Your hit counter is being incremented, anyway -- doesn't mean there are any new visitors.
(Hit counter could be faulty, for example.)
>
> $ipaddress = $_SERVER['REMOTE_ADDR'];
> $date = date ("M dS H:i:s");
>
> $message = "$page _ $ipaddress _ $date\n";
>
> $File = "track.txt";
> $Open = fopen($File, "a+");
> if ($Open){
>
> fwrite($Open, "$message");
> fclose ($Open);
> }
>
>
> I have been looking around for a script but can't seem to find one that
> works the way I want.
> anyone have such a script online somewhere?
Write your own, it's not that hard. You already have various scripts that insert data into
MySQL tables; here, you have a script that writes IP addresses into a text file. Pretty trivial
matter to modify this to write to a MySQL table instead.
|
|
|
Goto Forum:
Current Time: Fri Nov 22 05:39:31 GMT 2024
Total time taken to generate the page: 0.04462 seconds