kfc001 Posted October 22, 2007 Share Posted October 22, 2007 I need a free php script that counts how many people played the flash games on my website. I dont use SQL databse is this possible to get without using SQL database? Quote Link to comment https://forums.phpfreaks.com/topic/74351-free-php-script/ Share on other sites More sharing options...
only one Posted October 22, 2007 Share Posted October 22, 2007 Create a file called count.txt And save this a php file. <?php $fp = fopen("count.txt", "r"); $count = fread($fp, 1024); $count = $count + 1; echo "Page views: $count"; $fp = fopen("count.txt", "w"); fwrite($fp, $count); fclose($fp); ?> Quote Link to comment https://forums.phpfreaks.com/topic/74351-free-php-script/#findComment-375654 Share on other sites More sharing options...
kfc001 Posted October 22, 2007 Author Share Posted October 22, 2007 Create a file called count.txt And save this a php file. <?php $fp = fopen("count.txt", "r"); $count = fread($fp, 1024); $count = $count + 1; echo "Page views: $count"; $fp = fopen("count.txt", "w"); fwrite($fp, $count); fclose($fp); ?> If we got many diffrent games does this count overall for all games played or can i put it in each singel game so it counts each singel game? Quote Link to comment https://forums.phpfreaks.com/topic/74351-free-php-script/#findComment-375658 Share on other sites More sharing options...
only one Posted October 22, 2007 Share Posted October 22, 2007 No, you will have too keep creating new files for each game. Quote Link to comment https://forums.phpfreaks.com/topic/74351-free-php-script/#findComment-375663 Share on other sites More sharing options...
kfc001 Posted October 22, 2007 Author Share Posted October 22, 2007 Okay i see, so i need to make a script for each game right? am just a 19 year old girl, dont know much about this stuff yet, i just started to make my own sites. Quote Link to comment https://forums.phpfreaks.com/topic/74351-free-php-script/#findComment-375667 Share on other sites More sharing options...
kfc001 Posted October 22, 2007 Author Share Posted October 22, 2007 Is it a fast way to do this because i got over 1000 games, and to make 1000 diffrent scripts would take me forever, is there a shortcut? Quote Link to comment https://forums.phpfreaks.com/topic/74351-free-php-script/#findComment-375679 Share on other sites More sharing options...
lewis987 Posted October 22, 2007 Share Posted October 22, 2007 database ha, other than that, no... that script you got is the best way... Quote Link to comment https://forums.phpfreaks.com/topic/74351-free-php-script/#findComment-375689 Share on other sites More sharing options...
rlindauer Posted October 22, 2007 Share Posted October 22, 2007 Isn't this information available in your apache access logs? I would just setup Google Analytics and check for hits to a certain page or query string. You would be able to get more information than a simple total number of hits. Quote Link to comment https://forums.phpfreaks.com/topic/74351-free-php-script/#findComment-375691 Share on other sites More sharing options...
only one Posted October 22, 2007 Share Posted October 22, 2007 Okay i see, so i need to make a script for each game right? am just a 19 year old girl, dont know much about this stuff yet, i just started to make my own sites. I'm just a 15 year old boy . And why can't you just use a MySQL database? It makes things allot easier. Quote Link to comment https://forums.phpfreaks.com/topic/74351-free-php-script/#findComment-375715 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.