How to create an answer submit button?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sapera
    New Member
    • Sep 2010
    • 1

    #1

    How to create an answer submit button?

    I want to create an text field then a submit button.

    The text field is supposed to be the answer of a question.
    If the user types the correct answer and clicks submit, he is taken to the next page. If he types the wrong answer the page refreshes to the current page.
    Also if the user knows the url of the next page, while he is on the current page and type it in the url bar, it should be shown that you are not authorised to view this page.(Use of checks, i suppose)

    Please help me with use of databases as well.
  • kovik
    Recognized Expert Top Contributor
    • Jun 2007
    • 1044

    #2
    Post the answer to a page that checks it. You can save the questions and answers in the database and use that data to check. If the answer is right, send them to the next page. If not, send them to the previous one. Save their progress in a session, and use that to check whether they are authorized to access any particular question.

    Comment

    • Canabeez
      New Member
      • Jul 2009
      • 126

      #3
      You could even post it to the same page, do the answer/session checks on the backend and printout the page.

      Comment

      Working...