Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 04-27-2007, 10:31 AM   #1 (permalink)
smart@gayu
Recruit
 
Join Date: Apr 2007
Posts: 1
smart@gayu is on a distinguished road
Lightbulb plz help-logout code not working..

<?
session_start();
unset($_SESSION['user']);
session_destroy();
echo "You have been successfully logged out.

<br><br>
You will now be returned to the login page.

<META HTTP-EQUIV=\"refresh\" content=\"2; URL=index.html\"> ";
?>


i wrote above code for logout.it works but prblm is if frm logout.php page which inturn shows index.html page i click on back button then it displys me the previous page.i dont no how to deal with this.plz help.and if i want the logout link on each page shld i add the above code to evry page?suggest me.
thanks in advance.
smart@gayu is offline   Reply With Quote
Old 04-28-2007, 07:31 PM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,487
sde is on a distinguished road
seems like you need to add code to the previous page which redirects the user if they don't have a valid session, otherwise, depending how you coded it, it may keep the session alive.

PHP Code:
<?php
if (!$_SESSION['user']) {
  
header("location: login.php");
  exit;
?>
__________________
Mike
sde is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
need help plz newbie_paul HTML, XML, Javascript, AJAX 2 02-05-2007 09:39 AM
how the servlet will integrate the LDAP code j.gohel Java 19 04-16-2005 12:55 AM
Cisco Code breaking sde Code Newbie News 0 05-21-2004 07:10 AM
Microsoft probes Windows code leak redhead Code Newbie News 0 02-13-2004 12:41 AM


All times are GMT -8. The time now is 07:18 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting