Jump to content
xisto Community
Sign in to follow this  
Triple X

Anyway To Make A "how Many Times Played" Script? Help..

Recommended Posts

http://forums.xisto.com/no_longer_exists/

I was wondering, is there anyway to make a php script so I can put a thing under the thumbs like "This game has been played # many times" or something? I mean maybe like how many times its been clicked cuz that might work...I dunno I was just wondering. If there is a way(I'm sure there is..) could someone tell me? thanks.

EDIT: oh and yes I have the right to use those games on my site, funflashgames lets you freely do it as long as you have the comment in the source(which I do, I changed it but it gives credit and thats all they ask). I'm going to try google for other ones I can put on it later.
Edited by Triple X (see edit history)

Share this post


Link to post
Share on other sites

Its very easy using PHP and MySQLYou simply need a MySQL database, with one table containing one row, containing a number (and an identifier for using a WHERE statement if you want to do it like that)Then every time a page is accessed, you access the database, get the number in the database, increment it by 1. and replace the original number with the incremented one.Of course, this is just page accesses, so you could put in some stuff so each IP is only logged once a day, or, for a play count, you could use a javascript onClick event, so when someone clicks on the flash game, it opens a page in an iframe or a frame with no size, that increments it. This way, web crawlers will not increment the counter, and the counter will only go up if someone clicks on the game!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.