I would like to fill out a form on an html page and then send the completed form to another html to check the entries there and then save them. I just don’t know how to send the data from one html to another. I ask you to help me. Thanks
I’m not understanding what you’re trying to ask here.
For clarity, you don’t pass data from one html page to another.
The general flow of events is that:
The browser requests a page
The server returns a page containing a form
The browser submits the form with data
The server validates the form and saves the data to the database
The server redirect the browser to a different page
That different page can read the data from the database to render a new page. (It’s not required to read the data just saved - it could read any data.)
Now, it’s not required that you save the submitted data to the database. You could immediately use that data to render a new page, but if that page isn’t a form allowing the data to be submitted back to the server, you will not have a way of keeping the data.
Please try rephrasing your question, and providing more detail and specifics about what you’re trying to do.
Thanks for your answer
On the question.html users have the possibility to post questions for a quiz game, but before the question is posted in the game, the question has to be checked first. That’s why the admin gets an email after a player has posted a question (that a new question has been received) and in the email is a link that leads to the approve_question.html and there should be the question posted by the user and if the question is ok the question should be saved. I hope you can help me.
Hi there! From what I understand, you’re looking to pass data from one HTML page to another for approval before saving. One approach could be to use Django’s session framework to temporarily store the question data after submission. When the admin accesses the approve_question.html page, you can retrieve the data from the session, display it for approval, and then save it to the database if approved. This way, you can ensure that the question is reviewed before it’s added to the quiz game.
This is really difficult to do when the person submitting the question is different from the person needing to approve it. Accessing session data that doesn’t belong to you creates the possibility of all sorts of potential security implications.
Additionally, storing this in the session is only valid as long as the person submitting it keeps this as an active session. If that user logs off before the question is reviewed and approved, then the questions is lost because the session is no longer valid.
Saving it to the database is going to be the more appropriate and secure solution.