Tacomon
05-07-2006, 12:56 AM
Here's my scenario:
I'm creating a mini-game on my site where users can compete against each other. I have an initiate page, where you get a listing of your stats and your opponent's and a link to initiate the event. This link goes to an immediately redirecting page that enters the results of the event into the database. The redirect ends up at a results page.
event.php?initiate -> event.php?enterdb -> event.php?showresults
Assuming that I have around 15-20 values to pass across to the enterdb and showresults pages, what is the best way to go about this?
The options that I know of are:
- put all the values in the url query string (which would be quite lengthy)
- put all the values into an array and serialize/unserialize
- put all the values into a session and destroy it upon reaching the results page
- do one of the above to get the values to the enterdb page, and make a call to the database on the showresults page
Things I want to take into consideration:
- code speed/minimizing database calls
- protecting the values coming into the enterdb page to prevent abuse (entering custom values)
I'm creating a mini-game on my site where users can compete against each other. I have an initiate page, where you get a listing of your stats and your opponent's and a link to initiate the event. This link goes to an immediately redirecting page that enters the results of the event into the database. The redirect ends up at a results page.
event.php?initiate -> event.php?enterdb -> event.php?showresults
Assuming that I have around 15-20 values to pass across to the enterdb and showresults pages, what is the best way to go about this?
The options that I know of are:
- put all the values in the url query string (which would be quite lengthy)
- put all the values into an array and serialize/unserialize
- put all the values into a session and destroy it upon reaching the results page
- do one of the above to get the values to the enterdb page, and make a call to the database on the showresults page
Things I want to take into consideration:
- code speed/minimizing database calls
- protecting the values coming into the enterdb page to prevent abuse (entering custom values)