Showcase and discover digital art at yex

Follow Design Stacks

Subscribe to our free newsletter to get all our latest tutorials and articles delivered directly to your inbox!

Building a Forum with Dreamweaver – Part 2: Creating the Logout Link

Creating the Logout Link

Although an automatic logout takes place when the session expires or the browser window is closed, you must add an explicit logout link which enables users to clear the session information safely. You must add this link to the following forum pages:

  • reply_message.php
  • view_message.php
  • post_message.php
  • index.php

The following steps explain how to create the link on the forum home page. You will need to repeat the steps for the other pages as well:

  1. Open index.php in the Code view.
  2. Place the cursor after the Login link in the top-right <div> container (the one with the white links inside).
  3. Apply the Logout User server behavior from the Server Behaviors tab by selecting Plus (+) > MX Kollection > User Login.
  4. Configure the dialog box as shown in Figure 26:

    1. Select the first option button; the the logout operation will be triggered by a link. From the pop-up menu, select Create New Link: “Logout”.
    2. After users log out, they will be redirected to the forum home page. Click the Browse button and select the index.php page.

    Configuring the Logout User behavior

    Figure 26. Configuring the Logout User behavior

  5. Click OK to apply the server behavior.

Notice that the Logout link is created (see Figure 27).

Logout link

Figure 27. Logout link

Repeat these steps for the reply_message.php, view_message.php, and post_message.php pages.

Not all links must be visible all the time. Logged-in users have no need to see the Login and Register links, just as the Logout link means nothing for the user who hasn’t logged in or doesn’t have an account. In the next section, you will use conditional regions to control which links are displayed and when.

Comments