The HTML form will contain just two fields: username and password. Both are required.
Open a new file in your text editor and type the following HTML:
<HTML> <HEAD> <TITLE>Login</TITLE> </HEAD> <BODY> <H1>Login to Secret Area</H1>
Begin your form. Assume that the method is POST and the action is a script called do_authuser.php:
<FORM METHOD="POST" ACTION="do_authuser.php">
Create an input field for the username with a text label:
<P><STRONG>Username:</STRONG><BR> <INPUT TYPE="text" NAME="username" SIZE=25 MAXLENGTH=25></p>
Create an input field for the password with a text label.
<P><STRONG>Password:</STRONG><BR> <INPUT TYPE="password" NAME="password" SIZE=25 MAXLENGTH=25></p>
Add a submit button, and then close your form and add some more HTML so that the document is valid:
<P><INPUT TYPE="SUBMIT" NAME="submit" VALUE="Login"></P> </FORM> </BODY> </HTML>
Save the file with the name show_login.html, and place this file in the document root of your web server.
Open your web browser and type http://127.0.0.1/show_login.html.
You will see the login form, with text fields for the username and password as well as a submit button.
Next, you create the back-end script for the login form.