Exercise 11.1

This is Exercise #11.1, lecture on communicating with backend, used in the course IDATA2301 Web technologies at NTNU, campus Aalesund.

Go back to exercise list.

Purpose

The purpose of the exercise is try out creating an HTML form that submits data to a server.

Instructions

  1. Create a document with an HTML form.
  2. Set the forms method to POST and target (the URL of the receiving script) to https://web-tek.ninja/php_backend/dummy_login.php
  3. Add the following input fields in it:
    1. A text input with name username and default value "john".
    2. A password input with name key.
    3. Add labels for the inputs
    4. Add a hidden field with a name and value of your choice.
  4. Add a "Submit form" button.
  5. Try to post the form. You should get an HTML page in response (generated by a dynamic PHP script on the server). Check out what the page is saying and find what you need to enter in the key field to get a "total success" :).

Solution

You can find a solution here.