ok this is a little problem i've been having with a trivia game script i've been working on...
here's the scenario..
the user clicks "start a new game", which loads a page that creates a row in a MySQL database with a Unique ID for the user as well as sets the cookie for the UID, that page instantly redirects to a 3rd page where you select the category for the trivia question as well as select your wager for the upcoming question.
after the user had made their selections they are sent to a page that selects a question from the database, while another query updates the users history to make sure the question selected is not asked again, this page auto redirects you to the question page... here's where i'm having my problem...
i have a counter script (javascript) on the question page that counts down 30 seconds and then auto submits the form... the counter is displayed in a text field.
here's the code for the counter:
<form name="counter">
<input type="text" size="8" readonly name="d2" class=count></form>
<script>
<!--
//
var milisec=0
var seconds=30
document.counter.d2.value='30'
function display(){
if(seconds == 0 && milisec == 0){
document.forms.form1.submit()
}
if (milisec<=0){
milisec=9
seconds-=1
}
if (seconds<=-1){
milisec=0
seconds+=1
}
else
milisec-=1
document.counter.d2.value=seconds+"."+milisec
setTimeout("display()",100)
}
display()
-->
</script>
Now my problem is that the user can simply refresh the page to reset the counter and give them more time to answer... i would like to figure out a way to stop people from being able to reset that counter by refreshing or using the back button...
any idea??
p.s. i've thought about going all Flash so that a refresh would totally start the game over... but flash frames stop when you right-click or click and hold anywhere on the page... so that wouldn't work either...