Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Vista

Dreamweaver CS5 : Standard Server Behaviors (part 4) - Update Record, Delete Record & User authentication

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
7/12/2012 6:09:08 PM

9. Update Record

Use the Update Record server behavior to modify existing records in a data source.

Requirements: A recordset, a form with form elements linked to the dynamic data, and a Submit button.

To insert an Update Record server behavior, follow these steps:

  1. From the Server Behaviors panel, choose Update Record. The Update Record dialog box appears, as shown in Figure 9.

    Figure 9. With an Update Record server behavior, you can modify your data source remotely.
  2. From the Update Record dialog box, choose a connection from the drop-down list. To establish a new connection, click Define.

  3. Select the data table you want to use from the Update table list.

  4. Choose the data source on which to base your update from the Select Record From list.

  5. Select the key field from the Unique Key Column list. Dreamweaver attempts to detect whether the field is a number type and if so, selects the Numeric option.

  6. Enter the path to the destination page in the After Updating, Go To field or click the Browse button to locate the file.

  7. Select the name of the form to be used from the Get Values From list. If there is only one form on the page, the form is preselected.

  8. For each object listed in the Form Elements area:

    • Select the data source field into which the form object's value is to be inserted from the Columns list.

    • Choose the data source type for the data from the Submit As list. The options are Text; Numeric; Date; Date MS Access; Checkbox Y, N; Checkbox 1,0; Check −1,0; and Checkbox MS Access.

  9. Click OK when you're finished.


10. Delete Record

The Delete Record server behavior is used to remove existing records from a data source.

Requirements: A recordset, a form, and a Submit button.

To attach a Delete Record server behavior to a form, follow these steps:

  1. Make sure that a form exists on a dynamic page that includes at least one recordset.

  2. From the Server Behaviors panel, choose Delete Record. The Delete Record dialog box is displayed, as shown in Figure 10.

  3. HP and ColdFusion users: Choose the desired option from the First Check If Variable Is Defined List.

    Leave the entry set to Primary Key Value if you are using a form to confirm the deletion. If you want the deletion to occur without confirmation, choose another entry from the list such as URL Parameter or Form Variable.

  4. From the Connection list, choose a connection from the drop-down list.

  5. Select the data table you want to modify from the Table list.

    Figure 10. Maintain an up-to-date data source with the Delete Record server behavior, shown here for a PHP page.
  6. Select the key field from the Primary Key Column list. Dreamweaver attempts to detect whether the field is a number type and if it is, selects the Numeric option.

  7. Choose the variable that holds the Primary Key value from that menu and enter the name of the variable in the adjacent field.

  8. Enter the path to the destination page in the After Deleting, Go To field or click the Browse button to locate the file.

  9. Click OK when you're finished.


11. User authentication

The World Wide Web is all about accessing information from anywhere in the world. Sometimes, however, you need to restrict access to certain areas of your site to authorized users. Dreamweaver supplies a full complement of server behaviors to support authenticating the user against a specified data source.

11.1. Log In User

The Log In User server behavior redirects authorized users to one page and unauthorized users to another and creates a session variable for the username.

Requirements: A recordset, a form, appropriate form elements for a username and a password, and a Submit button.

  1. From the Server Behaviors panel, click the Add (+) button and choose User Authentication => Log In User. The Log In User dialog box is displayed, as shown in Figure 11.

  2. If there is more than one form on the page, select the form containing the username and password fields from the Get Input From Form list.

    Figure 11. The Log In User server behavior verifies that the user may be granted access.
  3. Select the form element used to gather the username from the Username Field list.

  4. Select the form element used to gather the password from the Password Field list.

  5. Choose a connection to the data source containing the table of registered users from the Validate Using Connection list.

  6. Select the table of registered users from the Table list.

  7. Choose the field containing the username from the Username Column list.

  8. Choose the field containing the password from the Password Column list.

  9. Enter the path to the page for the authorized user in the If Login Succeeds, Go To field.

  10. If you want the user to proceed to the previously selected link, rather than the page entered in Step 9, select the Go To Previous URL option.

  11. Enter the path to the page for the unauthorized user in the If Login Fails, Go To field.

  12. If access levels should be evaluated as part of the authentication:

    • Select the Restrict Access Based On Username, Password, And Access Level option.

    • Choose the data source field containing the access level data from the Get Level From list.

  13. Click OK when you're finished.

11.2. Restrict Access To Page

The Restrict Access To Page server behavior prevents unauthorized users from viewing specific pages by checking a session variable. After it is defined, the server behavior can be copied and pasted onto another page by using the context menu commands from the Server Behaviors panel.

Requirements: A dynamic page.

To apply the Restrict Access To Page server behavior, follow these steps:

  1. From the Server Behaviors panel, click the Add (+) button and choose User Authentication => Restrict Access To Page. The Restrict Access To Page dialog box, shown in Figure 12, is displayed.

  2. If you don't want to restrict admission by access levels, be sure that the Restrict Based On Username And Password option is selected.

  3. To set group permissions for the page:

    • Choose the Restrict Based On Username, Password, And Access Level option.

    • Choose one or more groups from the Select Level(s) area.

    Figure 12. Any dynamic page can be protected against unauthorized viewing with the Restrict Access To Page server behavior.
  4. To add new groups to the Select Level(s) list:

    • Click Define. The Define Access Levels dialog box opens.

    • Enter the name for the access level in the Name field. The name must match a value stored in your data source in whichever column is designated for the group access levels.

    • To add additional levels, click the Add (+) button and enter another name.

    • To delete any levels, choose the level in the list area and click the Remove (−) button.

    • Click OK to close the Define Access Levels dialog box.

  5. Enter the path to the file to which you want to redirect unauthorized users in the If Access Denied, Go To field. Alternatively, click the Browse button to locate the file.

  6. Click OK when you're finished.


11.3. Log Out User

The Log Out User server behavior clears the username session variable established by the Log In User server behavior and redirects the user to an exit page. You can set up the Log Out User server behavior so that a user selects a link to log out or is automatically logged out when a particular page, such as one confirming the completion of an order, is viewed.

Requirements: A Log In User server behavior on another page.

To use the Log Out User server behavior, follow these steps:

  1. To apply the server behavior to a specific link on the page, select that link.

  2. From the Server Behaviors panel, click the Add (+) button and choose User Authentication => Log Out User. The Log Out User dialog box displays (see Figure 13).

    Figure 13. You can log a user out automatically by choosing the Log Out When Page Loads option on an order confirmation page.
  3. To trigger the server behavior with a link, choose the Log Out When Link Clicked option and make sure that your selected link is chosen in the list. If no link was preselected, Dreamweaver offers to apply the server behavior to a new link, Log Out.

  4. To automatically log out users when the current page is viewed, select the Log Out When Page Loads option.

  5. If you're using a link as a trigger, enter the path to the destination page in the When Done, Go To field. Alternatively, click the Browse button to locate the file.

    Do not use the When Done, Go To option if you are automatically logging out a user when the page loads. If you do, the user never sees the current page.


  6. Click OK when you're finished.


11.4. Check New Username

The Check New Username server behavior verifies that the requested username is not already in the data source, redirecting the user if it is.

Requirements: An Insert Record server behavior, a form, and appropriate form elements.

  1. From the Server Behaviors panel, click the Add (+) button and choose User Authentication => Check New Username. The Check New Username dialog box is displayed, as shown in Figure 14.

    Figure 14. Make sure that a requested username is not already taken by using the Check New Username server behavior.
  2. Select the form element that contains the requested username from the Username Field list. If a form element is called USERNAME, Dreamweaver automatically selects that entry.

  3. In the If Already Exists, Go To field, enter the path to the file you want a user to see if the name the user requested is already stored in the data source. You can also click Browse to locate the file.

  4. Click OK when you're finished.

Other -----------------
- Dreamweaver CS5 : Standard Server Behaviors (part 3) - Go To Detail Page, Related Page & Insert Record
- Dreamweaver CS5 : Standard Server Behaviors (part 2) - Recordset Paging, Move To Specific Record & Show Region
- Dreamweaver CS5 : Standard Server Behaviors (part 1) - Recordset & Repeat Region
- CorelDRAW X5 : Text and Styles
- CorelDRAW X5 : Wrapping Text Around Other Shapes
- Adobe Illustrator CS5 : Working with Layers - Flattening Layers & Locating Objects in the Layers Panel
- Adobe Illustrator CS5 : Working with Layers - Moving Objects to a Layer
- Adobe Photoshop CS5 : The Essential Adjustments: White Balance
- Adobe Photoshop CS5 : Miss the JPEG Look? Try Applying a Camera Profile
- Adobe Fireworks CS5 : Working with Adobe AIR (part 4) - Installing the prototype
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server