Hi all,
Im very new to php. Currently im creating an online exam system which uses php and mysql as the database. I have registration and login page which works pretty fine. I had problem when it comes to question page. I have about 20 questions. As soon the user login to the system, he should start answering. The system should remember the number of correct answers til the 20th question. I used session to hold the value of number of correct answers. For example :
Login.php login and redirect to ques1.php
ques1.php first question, click submit to redirect to ques2.php
ques2.php second question. Click submit to go to ques3.php or click back to return to ques1.php
The problem is when I click back button the counter which holds the value of correct answer doesn’t work properly.
Let say I’ve answered 3 questions correctly, the counter should show 3, then if click back button, it suppose become 2 but it doesn’t happen here. The counter increase becomes 4.
Code sample as below….
What should I change in my code?
Thank you.