php - Tracking Quiz Results with URL, No Database Allowed! -


I have to create a 10 page quiz for a mobile browser. This is just a mobile webpage, so there is no thought for other browsers should be done.

Here's my problem: I can not use Javascript because every mobile browser does not support it. I am not very proficient in other languages, but I thought that something like PHP could be done because it is server-side.

If my first url is domain and I enter the correct quiz answer, then the URL / domain on the next page? P = 1 The URL does not need to do anything but count the number of correct results.

For the actual code, I was thinking that it can be included in HTML, because I am not people are very worried about people viewing the source on their mobile phones.

Is it possible to write a line of code, which increases the 'p =' attribute in the URL when one click is done and it only engages in the correct answer?

Here's an image of what I mean:

And, what is Do I have to stop manually increase the "correct answer" counter in my address bar?

Do not want to use a database because you have no one available in your hosting, t know how?

I am not a fan of this idea, but you can get the number of "correct answers" with the following code.

  & lt;? Php / * currently gives correct answer count * / $ answer_count = $ _GET ["p"]; / * Check to see if the submitted response is similar to the correct answer / ($ _POST ["submit-answer"] == "correct-answer") {$ answer_count ++; }? & Gt;  

Now, you can only add modified answer numbers in the link to the next question.

  & lt; A href = "link-to-next-question.php /? P = & lt ;? php echo $ answer_count;? & Gt;" & gt; Next question & lt; / A & gt;  

If this is "for fun" then I do not know why you can not do this. This is definitely an easy way to solve the problem.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -