Prevent going back [SOLVED]
Posted: Sat Jul 09, 2011 6:09 pm
Hey there everyone
So I have a question that I am sure someone here has the answer to, but no matter how hard I look online, there doesn't seem to be a complete answer as to how to accomplish what I need it to. So I was wondering, how exactly do I prevent the user from going back a page? Let's say that they fight a monster, die, and are shown the screen that says for example "You died n00b, <a href="whatever.php"go back to the index page with less money and half health</a>" (I only included the <a href> tag to show where the link would be. Well my problem is, the user could just say "heh, silly game, I shall now press the back button and try again" and so they do, and nothing is stopping them. So how do I prevent them from doing this? And if I can't deny them from going back a page, how can I make it so that if they try to go back, it just keeps them on the same page they were on before?
Thanks everyone!
So I have a question that I am sure someone here has the answer to, but no matter how hard I look online, there doesn't seem to be a complete answer as to how to accomplish what I need it to. So I was wondering, how exactly do I prevent the user from going back a page? Let's say that they fight a monster, die, and are shown the screen that says for example "You died n00b, <a href="whatever.php"go back to the index page with less money and half health</a>" (I only included the <a href> tag to show where the link would be. Well my problem is, the user could just say "heh, silly game, I shall now press the back button and try again" and so they do, and nothing is stopping them. So how do I prevent them from doing this? And if I can't deny them from going back a page, how can I make it so that if they try to go back, it just keeps them on the same page they were on before?
Thanks everyone!