Activity 1: Integrating Security into an Application
1. Create a form.
2. Create a table in a database.
3. Type a few username and password for testing.
4. Close your database file and view back your dreamweaver file.
5. Save the file. Make sure your connection is working.
6. Click Server Behavioes > User Authentication > Log In User
7. Select the correct form and connection.
8. Make sure you select the correct table and also the correct fields for username and password.
9. Select also the html or ASP file for If Login Succeeds and If Login Fails.
10. For Restrict Access Based, just select Username and Password.
11. Click OK. Test your application.
12. Try to create the Logout Page.
Activity 2: Integrating Security into an Application with Registration Page
1. Create a table in a database to hold all the data from the registration page. Don't forget to set a Premiary Key to the id variable or username variable.
2. The registration page should ask information such as Name, Username, Password.
3. Text Field for password has to set up as password.
4. Use Insert Record bahavior.
5. No need to view back the registration information. Therefore, don't use RecordSet bahavior.
6. Create another ASP file for login page.
7. Use Login Behavior and please use a same table (that holds registration information) for the username and password.
Activity 3: Go To Related Page and Go To Detail Page
1. Create a page to view back the data of all the registered users.
2. Use RecirdSet and Repeat Region.
3. Highlight one user and Go To Detail Page or Go To Related Page Behavior to link the asp file to the file that view back the detail information of the user.
4. Prepare the detailed file by viewing back the detail information of the user. Create another RecordSet and filter it based on it. Please use this new RecordSet.
3. Type a few username and password for testing.
4. Close your database file and view back your dreamweaver file.
5. Save the file. Make sure your connection is working.
6. Click Server Behavioes > User Authentication > Log In User
7. Select the correct form and connection.
8. Make sure you select the correct table and also the correct fields for username and password.
9. Select also the html or ASP file for If Login Succeeds and If Login Fails.
10. For Restrict Access Based, just select Username and Password.
11. Click OK. Test your application.
12. Try to create the Logout Page.
Activity 2: Integrating Security into an Application with Registration Page
1. Create a table in a database to hold all the data from the registration page. Don't forget to set a Premiary Key to the id variable or username variable.
2. The registration page should ask information such as Name, Username, Password.
3. Text Field for password has to set up as password.
4. Use Insert Record bahavior.
5. No need to view back the registration information. Therefore, don't use RecordSet bahavior.
6. Create another ASP file for login page.
7. Use Login Behavior and please use a same table (that holds registration information) for the username and password.
Activity 3: Go To Related Page and Go To Detail Page
1. Create a page to view back the data of all the registered users.
2. Use RecirdSet and Repeat Region.
3. Highlight one user and Go To Detail Page or Go To Related Page Behavior to link the asp file to the file that view back the detail information of the user.
4. Prepare the detailed file by viewing back the detail information of the user. Create another RecordSet and filter it based on it. Please use this new RecordSet.
Set Up User Table and New Login Page
The first step to creating a login page is to make a table of users. To create this table, use the follow phpMyAdmin code:
Create Table users (username varchar(20) NOT Null default “,password varchar(20) NOT Null default “);
Next, open up Dreamweaver and open a new HTML page, titled “login.php”. Connect this page to your database. If your connection is successful, the application window should show the details of your table. While you are still in the “login.php” page, locate the word “Common” on your top navigation bar. When “Common” is clicked, a drop down menu will appear. From this menu, select “Application”. Next, select the last icon on the navigation bar and click “Log In User”.
Create Table users (username varchar(20) NOT Null default “,password varchar(20) NOT Null default “);
Next, open up Dreamweaver and open a new HTML page, titled “login.php”. Connect this page to your database. If your connection is successful, the application window should show the details of your table. While you are still in the “login.php” page, locate the word “Common” on your top navigation bar. When “Common” is clicked, a drop down menu will appear. From this menu, select “Application”. Next, select the last icon on the navigation bar and click “Log In User”.
Complete Login Table Fields
When “Log In User” is selected, a pop-up box will appear that allows you to fill in the details of your website login form. The first
section of the pop-up box will have you fill in basic information about your login page. The second section will have you fill in details about your database. The third section will act as a redirection based on the table structure of your database.
If a successful connection is made between your login page and database, this information will be displayed in the “Validate using connection” area. The last section of the pop-up box titled “Restrict access based on”, should have the choice “Username and password” checked only. Once you are finished completing the form, click “OK”.
If a successful connection is made between your login page and database, this information will be displayed in the “Validate using connection” area. The last section of the pop-up box titled “Restrict access based on”, should have the choice “Username and password” checked only. Once you are finished completing the form, click “OK”.
Check the Script and Save to Computer
To check to see if your script is in the proper place, go to “Applications” and then click the link titled “Server Behaviors”. Your script
name should be found in this panel. To edit this script anytime, simply double click. Save the “login.php” file to your computer, then upload to your website. Re-check the database to be sure that all information entered was correct.
No comments:
Post a Comment