November 28th, 2012, 04:02 AM
Getting data thrue multiple pages
Ok so I'm working on some sort of game in php. Soon I'm starting on the module for sending fleets (multiple units) away on missions and stuff.
Now here's the thing, The process of sending away units requires more then 1 page, probably 2 or 3. But in the end, im going to need the data from all pages.
Currently the way's I'm thinking about:
- Store it all in session or cookies
- ( not likely to use but still an option ) Place the previous forms data from the post into hidden fields in the current form, and send it to the next one.
- Store the data in the database
Any idea's/Tips how to use this in a good way? Which of these, or maybe other methods would be good to use?
November 28th, 2012, 04:56 AM
if this is just temporary data that's supposed to vanish after a logout, put it into a session. Otherwise use the database.
November 28th, 2012, 05:16 AM
After completing all pages, a "fleet movement" will be added to the database, existing of calculated variables created from the data of all the pages together. The partial data, from each page individually will not be needed after completing the process.
I will use sessions then. It will be easy to use and clean up after. Thanks for your input.
November 28th, 2012, 02:17 PM
You could also use something like memcache