sai Posted July 5, 2007 Share Posted July 5, 2007 Hi. I created a dice game in PHP, that randomly generates dice. My problem is that if the player does not like his/her dice, they can refresh or use the back buttons on the browser to generate new dice. What code can I put so that if the player clicks the refresh or back button, the browser would stop it, or redirect them to another page? Thanks Quote Link to comment Share on other sites More sharing options...
akitchin Posted July 5, 2007 Share Posted July 5, 2007 you can set a SESSION variable when they get their dice, and check for that before you assign a set. if the SESSION var is there, don't show them dice (and consequently do what you want: redirect, give an error, etc.), otherwise assign a set. if you're tracking them via a database or some other means, then simply add a flag to their specific information set to say they've already been assigned their dice. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.