Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Arno Welzel Newsgroups: comp.lang.php Subject: Re: tracking IP's Date: Tue, 02 Jul 2013 10:53:01 +0200 Lines: 40 Message-ID: <51D294ED.5030706@arnowelzel.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: individual.net XYTTidr0YuBAQMlY5KuivgLpXT299MsqBme/5EncfInR4iuV4K Cancel-Lock: sha1:O5Mj2XWB/DpBHEYG6lhX7k/bjnY= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 In-Reply-To: Xref: csiph.com comp.lang.php:10020 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