Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-23-2012, 11:06 PM   PM User | #1
camzenxbt
New Coder

 
Join Date: Aug 2011
Location: England
Posts: 23
Thanks: 9
Thanked 0 Times in 0 Posts
camzenxbt is an unknown quantity at this point
Lightbulb users individual recent game name history

Hi there,

I wanted to make a page where logged in users can see the recent 10 flash games they played via my website (as in the page would show the names of the games)

Is there some way this could be done so each individual user could have their own list of the recent 10 games they played?. Would this have to be stored in a database?. I'm not a genius with PHP (Im a student) and I'm creating my first website for testing really whilst I learn PHP and would hope to publish it in the future. But I have searched google and can not find any results as to my required needs.

The website I am building is going to be a flash games based website, where users can play flash games free (much like Miniclip).

Thanks for any contributions! Let me know if the question is too confusing!

- Camzenxbt
camzenxbt is offline   Reply With Quote
Old 08-24-2012, 08:17 AM   PM User | #2
WingTsun
New Coder

 
Join Date: Jan 2012
Location: Latvia
Posts: 65
Thanks: 8
Thanked 2 Times in 2 Posts
WingTsun is an unknown quantity at this point
Hello, I am a beginner aswell, but I can direct you a little to the right direction.

You should create a Sql Table, witch would hold the user activity. And develop a simple PHP Code, witch executes a simple query to the table you created, when a logged in user enters the page of the game. Query could contain a simple information of the UserId, GamePlayed, and Time. So after this, you will be able to pull the statistics from the table about every recent user activity.

This could be a very basic solution, but for a school work it could be ok.
__________________
"Be formless... shapeless, like water. Now you put water into a cup, it becomes the cup. You pour water into a bottle; it becomes the bottle. You put water into a teapot; it becomes the teapot. Now water can flow, or creep or drip or crash! Be water, my friend..." by Bruce Lee
WingTsun is offline   Reply With Quote
Users who have thanked WingTsun for this post:
camzenxbt (08-25-2012)
Old 08-24-2012, 05:22 PM   PM User | #3
Keleth
Senior Coder

 
Join Date: Jun 2008
Location: New Jersey
Posts: 2,354
Thanks: 45
Thanked 247 Times in 244 Posts
Keleth is on a distinguished road
A database is easily the best method, and just like WingTsun said, simple enough with only 3 database columns. Presumably, you already have a database setup, as you're talking about logged in users.

If you don't wanna do it that way, a much messier way would be cookies. Store a cookie with a concatenated list of the last games played, and every time someone plays a game, add to that list; if the lists exceeds 10, drop the first one.
Keleth is offline   Reply With Quote
Users who have thanked Keleth for this post:
camzenxbt (08-25-2012)
Old 08-25-2012, 09:02 AM   PM User | #4
camzenxbt
New Coder

 
Join Date: Aug 2011
Location: England
Posts: 23
Thanks: 9
Thanked 0 Times in 0 Posts
camzenxbt is an unknown quantity at this point
Smile

Thank you all for your help!. I shall start using this method now, I never thought of that!.

- Camzenxbt
camzenxbt is offline   Reply With Quote
Reply

Bookmarks

Tags
game, page, recent, user, visited

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:27 AM.


Advertisement
Log in to turn off these ads.