close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Logout Button

Thread began 9/10/2010 7:54 am by info344553 | Last modified 9/10/2010 1:07 pm by Jason Byrnes | 3067 views | 5 replies |

info344553

Logout Button

Hi

I have just created user registration pages for a client. This is so the user can submit their details for future contact.
What I need is a logout button for the profile page so once the user has updated their details they can logout.

Thanks in advance.

Sign in to reply to this post

Jason ByrnesWebAssist

If you have cookies toolkit installed while running the wizard, a logout page will automaticly be created.


you can create a new logout page and add the following code at line 1L

php:
<?php

if (!isset($_SESSION)) {
  
session_start();
}
?><?php 
if ("" == ""){
  
// WA_ClearSession
    
$clearAll TRUE;
    
$clearThese explode(",","");
    if(
$clearAll){
        foreach (
$_SESSION as $key => $value){
            unset(
$_SESSION[$key]);
        }
    }
    else{
        foreach(
$clearThese as $value){
            unset(
$_SESSION[$value]);
        }
    }
}
?>




this will log the user out.

Sign in to reply to this post

info344553

Hi

Thanks for the reply. What I want to happen is when a user has registered and has a need to change their details is, they log in which takes them straight to their profile so they can update if necessary.

Once the profile has been updated I need a button next to the update button so they can log out and go to another page on the site.

Does this make sense??

Thanks





Originally Said By: Jason Byrnes
  If you have cookies toolkit installed while running the wizard, a logout page will automaticly be created.


you can create a new logout page and add the following code at line 1L
php:
<?php

if (!isset($_SESSION)) {
  
session_start();
}
?><?php 
if ("" == ""){
  
// WA_ClearSession
    
$clearAll TRUE;
    
$clearThese explode(",","");
    if(
$clearAll){
        foreach (
$_SESSION as $key => $value){
            unset(
$_SESSION[$key]);
        }
    }
    else{
        foreach(
$clearThese as $value){
            unset(
$_SESSION[$value]);
        }
    }
}
?>



this will log the user out.  
Sign in to reply to this post

Jason ByrnesWebAssist

you just need to add the link to the logout page:
<a href="logout.php">Log out</a>


if you want that link to be a button image:
<a href="logout.php"><img src="logout.jpg" /></a>

Sign in to reply to this post

info344553

Hi,

Thank you!!

That sorted it. I did not thing that just linking to the logout page would actually close the connection, but it does.

Thanks Again.




Originally Said By: Jason Byrnes
  you just need to add the link to the logout page:
<a href="logout.php">Log out</a>


if you want that link to be a button image:
<a href="logout.php"><img src="logout.jpg" /></a>  
Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...