I am developing a Question & Answer website where a user is presented five puzzles on a page and the score is calculated using JavaScript as he attempts the questions on the page. The score is saved in a Javascript variable score
. I have a paging system like this:
Now when the user clicks on 3 I want to send the variable score
to the next page, where I have require scoreUpdateInDatabase.php
on each such page such that the score of previous page is made permanent to the databse and the following PHP script presents him the next 5 questions.
How can I pass that score
variable in secure way? I can't use GET
because the user will modify it. I am satisfied with POST
if this can be used, even though POST
data can be modified but I just want minimal security.
P.S. Please do not suggest making AJAX call where in one side I will send score
and while returning carries next 5 questions. I don't want to use AJAX to refresh content because it is not SEO friendly.