I have a page for asking queries to an SQL database. Its only purpose is to allow students to exercise. Depending on the students activity the page rewrites itself with new content so that the student may enter a query, have the resulting table shown or get an error message.
All is working through forms that post data to the same page.
However, if a student uses the back button or the forward button (after hitting the back button) data gets lost as I cleanse the $_POST variable content to get ready for new action.
There is, however, a “go back” button that assembles data to restore the previous page by POSTing the required data. Is it possible to use some kind of technique, javascript, html5, PHP or whatever to actually submit the form that posts the assembled data when hitting the browser back button?
I am using HTML 5, PHP 5 and some JavaScript (not JQuery but if it gives me an option …)
you can use the html5 storage since if user not fill the full form or close the browser the data will lost on close browser and not submit it form not fill
to check html5 storage
use onkeyup to store like
and next time when user open the form just show the content stored
to clear use