R
E
S
O
U
R
C
E
S
       Home      Products & Services      Contact Us      Links


WebHatchers will design & develop your site for you.
_______________________

Website Menu Heaven: menus, buttons, etc.
_______________________

Send us your questions.
_______________________

site search by freefind
_______________________

HOME
SEO, Google, Privacy
   and Anonymity
Browser Insanity
JavaScript
Popups and Tooltips
Free Website Search
HTML Form Creator
Animation
Buttons and Menus
Counters
Captchas
Image Uploading
CSS and HTML
PHP
AJAX
XPATH
Website Poll
IM and Texting
Databases—MySQL
   or Not MySQL
Personal Status Boards
Content Management
   Systems
Article Content
   Management Systems
Website Directory
   CMS Systems
Photo Gallery CMS
Forum CMS
Blog CMS
Customer Records
   Management CMS
Address Book CMS
Private Messaging CMS
Chat Room CMS
JavaScript Charts
   and Graphs




Free Personal Status Boards (PSB™)

Free Standard Free PSB

Free PSB Pro Version

Free Social PSB

Free Social PSB Plus (with Email)

Free Business PSB

Free Business PSB Plus (with Email)

PSB demo

Social PSB demo

Business PSB demo

So what's all this PSB stuff about?

Chart comparing business status boards

PSB hosting diagram

PSB Licence Agreement



Copyright © 2002 -
MCS Investments, Inc. sitemap

PSBs, social networking, social evolution, microcommunities, personal status boards
PSBs, social networking, business personal status boards
website design, ecommerce solutions
website menus, buttons, image rotators
Ez-Architect, home design software
the magic carpet and the cement wall, children's adventure book
the squirrel valley railroad, model railroad videos, model train dvds
the deep rock railroad, model railroad videos, model train dvds

Logout for Private Messaging on Your Website

private messaging

This page is a tutorial on putting a private messaging (PM) logout script on your website. It uses sessions and both JavaScript and PHP. The screenshot above is the private message inbox.

Let's check out the code. It starts with a PHP include function: include_once"checkid.php". This gets a session started. You need to do this before doing other session actions. The include file contains this script:

session_start();

if(!isset($_SESSION['sessionid'])){

session_unset();
session_destroy();

header('location: message-login.php');

}else{
// session logged
}

Now that we have established the fact that a legitimate user is trying to logout, we unset the session and then destroy the session. This is the correct protocol for ending sessions but you have to start the session with session_start() if these session functions are going to work. Finally, we send the user a friendly "See you soon!" message and send him back to the login script. You may have a better destination in mind, since all these private messaging apps are for installing private messaging on your website. It's up to you.

Name this file message-logout.php

<?php

include_once"checkid.php";

// message-logout.php

session_unset();
session_destroy();

echo '<script language="javascript">alert("See you soon!"); window.location = "message-login.php"; </script>';

?>