Re: [php-objects] DIRECTLY GO TO LOGIN PAGE AFTER CLICKING “LOGOUT” LINK

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<?php
//Start session
session_start();

//Unset the variables stored in session
unset($_SESSION['SESS_MEMBER_ID']);
unset($_SESSION['SESS_FIRST_NAME']);
unset($_SESSION['SESS_LAST_NAME']);

 header("Location:login.php");


?>



On Wed, Sep 29, 2010 at 8:56 PM, shanro_im <shanro_im@xxxxxxxxx> wrote:

>
>
> Hi all,
> My sample project opens "index.php" page for user login. On successful
> login it opens "member-index.php". When "Logout" link on "member-index.php"
> is clicked, it opens "logout.php" which has a link for login again.
>
> Please advise how can I avoid displaying "logout.php" and directly go to
> "index.php" when clicking "Logout" link on "member-index.php".
>
> "member-index.php" - Code
> =========================
> <?php
> require_once('auth.php');
> ?>
> <head>
> <title>Member Index</title>
> <link href="loginmodule.css" rel="stylesheet" type="text/css" />
> </head>
> <body>
> <h1>Welcome <?php echo $_SESSION['SESS_FIRST_NAME'];?></h1>
> <a href="member-profile.php">My Profile</a> | <a
> href="logout.php">Logout</a>
> <p>This is a password protected area only accessible to members. </p>
> </body>
> </html>
>
> "logout.php" - Code
> ===================
> <?php
> //Start session
> session_start();
>
> //Unset the variables stored in session
> unset($_SESSION['SESS_MEMBER_ID']);
> unset($_SESSION['SESS_FIRST_NAME']);
> unset($_SESSION['SESS_LAST_NAME']);
> ?>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
> <title>Logged Out</title>
> <link href="loginmodule.css" rel="stylesheet" type="text/css" />
> </head>
> <body>
> <h1>Logout </h1>
> <p align="center">&nbsp;</p>
> <h4 align="center" class="err">You have been logged out.</h4>
> <p align="center">Click here to <a href="index.php">Login</a></p>
> </body>
> </html>
>
> Thanks
>
> Shan
>
> 
>



-- 
Thanks & Regards
Vijayalakshmi


[Non-text portions of this message have been removed]



------------------------------------

Are you looking for a PHP job?
Join the PHP Professionals directory Now!
http://www.phpclasses.org/jobs/
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/php-objects/join
    (Yahoo! ID required)

<*> To change settings via email:
    php-objects-digest@xxxxxxxxxxxxxxx 
    php-objects-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux