FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » tracking IP's
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: tracking IP's [message #182066 is a reply to message #182065] Tue, 02 July 2013 02:03 Go to previous messageGo to previous message
Doug Miller is currently offline  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.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: PHP Mailto();
Next Topic: Sandbox
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 18:29:16 GMT 2024

Total time taken to generate the page: 0.29807 seconds