ScottC Posted August 4, 2009 Share Posted August 4, 2009 Hi guys, im trying to make a page for my game (called fugitives) and what i want it to do is, echo users / accounts onto a page that have been inactive for longer than 30 days. Then the active users, will see an inactive user on there page and they have to kill that user (its a mafia type game) before midnight. After midnight a new account will appear.I do know PHP to an extent, but i have never made a PHP page from scratch before (only fixed errors and added tiny things), so i was wondering if anyone could maybe give me some guidance on how i could start this page.Any help will be appreciatedThanks. Link to comment Share on other sites More sharing options...
justsomeguy Posted August 4, 2009 Share Posted August 4, 2009 You'll need to know how to connect and use a database and how to process forms. The PHP section on the w3schools site has brief tutorials on both of those, so that would be a good place to start. PHP has date/time functions that you can use to get the current time, and you would need to store the last login time for each user in the database so you know which ones are inactive. The game logic to fight the other character is sort of up to you, but it's pretty much just getting a random inactive account from the database and doing whatever you want to do with it. You may also want to think of a way to verify that 2 people aren't attacking the same person, if that matters. Link to comment Share on other sites More sharing options...
ScottC Posted August 4, 2009 Author Share Posted August 4, 2009 You'll need to know how to connect and use a database and how to process forms. The PHP section on the w3schools site has brief tutorials on both of those, so that would be a good place to start. PHP has date/time functions that you can use to get the current time, and you would need to store the last login time for each user in the database so you know which ones are inactive. The game logic to fight the other character is sort of up to you, but it's pretty much just getting a random inactive account from the database and doing whatever you want to do with it. You may also want to think of a way to verify that 2 people aren't attacking the same person, if that matters.I already have this game, and i have a last login date table in the database. Im just wondering how i would call the last login date, and actually print it onto the page. Thats what im stuck with. Link to comment Share on other sites More sharing options...
justsomeguy Posted August 4, 2009 Share Posted August 4, 2009 It depends how it's stored in the database, is a datetime field or int or how is it stored? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.