Building a Forum with Dreamweaver – Part 2: Building the Login Page
Building the Login Page
The layout of the login page is already created. You only have to apply the Login Form Wizard:
- Open the login.php page in Dreamweaver.
- Select and remove the placeholder text (“Login form here”).
Go to the MX Kollection tab of the Insert bar and click the Login Form Wizard icon (see Figure 22).
- This wizard consists of two steps. The first one is purely informative, displaying the settings you made in the Control Panel. Click Next to continue.
In Step 2 configure specific login options (see Figure 23):
- To enable users to remain logged in, select the Create “Remember Me” Checkbox option.
- To build a page that automatically generates a new password for a user and sends it by e-mail, select the Create “Forgot Password” Page option.
- Click Finish to complete the wizard and apply the changes.
The wizard automatically generates the application logic to verify whether the user and the password are correct and whether the account is active. It also generates the forgot_password.php file and a link to it in the login form (see Figure 24).
Save the page and upload it to the server. Make sure you also upload the forgot_password.php file. You can test the login form in your browser to see how it works. If you log in as an inactive user (user name: Angel, password: root), you will receive a warning message (see Figure 25).
In the next section, you will create a logout link that safely destroys all session variables.