Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unique visitors using PHP 1

Status
Not open for further replies.

rossmcl

Programmer
Apr 18, 2000
128
Hi,

Can someone please tell me how to find unique visitors to my Flash site

I am already using PHP to have a hit counter, but I want to also record unique users, so I guess I need to also record some information from the users machine (?) when they visit. I suspect I can also use PHP to do this, the only problem is I cannot store info in database, as I cannot use mySQL with my hosting company.

Is there a way I can store user information in a text file, and just append a record each time a new unique visitors comes to my site?

(there are not going to be large numbers of visitors to my site at launch (and when there is and a txt file becomes unmanageable, I will switch hosting companies so I can do it with a database).

Any help VERY much appreciated. I am a complete novice to Flash and PHP etc.
RM
 
create the text file

-to get the ip address you would use
$ip= $HTTP_SERVER_VARS["REMOTE_ADDR"]

-you would then load the contents of the text file into an array
//this pulls the end of line character out of each line
$fp = @fopen($filename, 'r');
if ($fp)
{
$array = explode("\n", fread($fp, filesize($filename)));
}

Then compare the array to the incoming IP -- if there isn't a match then write new entry to the text file

I imagine the PHP forum may be more helpful than the flash one...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top