#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    18
    Rep Power
    0

    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
    - Maybe using javascript to cycle thrue the pages without submitting each one, and then one submit at the end.
    - ( 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?
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Hi,

    if this is just temporary data that's supposed to vanish after a logout, put it into a session. Otherwise use the database.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    18
    Rep Power
    0
    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.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    3
    Rep Power
    0
    You could also use something like memcache

IMN logo majestic logo threadwatch logo seochat tools logo