Home »
Imported messages »
comp.lang.php »
tracking IP's
Re: tracking IP's [message #182067 is a reply to message #182065] |
Tue, 02 July 2013 08:53 |
Arno Welzel
Messages: 317 Registered: October 2011
Karma:
|
Senior Member |
|
|
Am 02.07.2013 02:37, schrieb richard:
> 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.
> I know this because my hit counter shows there has been new visitors.
How do you check the counter? If you refresh the page with the counter
in your browser this is of course also a hit - but just by you.
> $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?
A script is not enough - you also need a database and a table for this.
Try to learn PHP and at least the basics of SQL and do not just
copy&paste - otherwise you will have scripts with security holes just
because you don't understand what the scripts really do and you don't
see the security problems in the code.
--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
|
|
|
Goto Forum:
Current Time: Thu Nov 28 08:24:41 GMT 2024
Total time taken to generate the page: 0.05537 seconds