| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Registered User
Join Date: Feb 2004
Posts: 2
|
hi php gurus, i've been searching for a solution on how to logout a session login in a frame-based website. (i know frame is not much of pactice for today's web development, sorry if i bother to use frames) premise: 1. index.php - pages w/ frames (4) - checks if login session is set, if not redirect to login.php --------------- --------------- | | | | | | --------------- --------------- 2. login.php - login page is working, connects to db, sets login session, then redirect to index.php 3. logout.php - in the framed-pages after logging-in, i have a log-out link (this link is placed on the top frame). the logout page destroys/unset session, then *SHOULD* redirect the page to login.php (using php function: header(); ). the behaviour of logout procedure is it redirects to login.php *ON* its frame window. problem: how do i redirect the logout to login.php, basically not on index.php frames thanks in advance. crisjr. |
|
|
|
|
|
#2 (permalink) |
|
I Ain't Losing Any Sleep™
Join Date: Apr 2003
Posts: 5,236
|
You'd have to use some kind of javascript I reckon. I haven't got time now but something like this in logout.php maybe? <script type="text/javascript"> if(top!=self){ top.location=self.location; } </script> I'm might have misunderstood your description though! The simplest solution is to not use frames. php includes would do your job much easier and elegantly. That's fuckin' ingenious, if I understand it correctly. It's a Swiss fuckin' watch.
|
|
|
|
#4 (permalink) | |
|
Registered User
Join Date: Mar 2004
Location: Derby, UK
Posts: 24
|
Quote:
You should just be able to set the target of the logout link to point to the top frame that way the logout page and then the following login page will load into that top frame. Best to avoid javascript when it is not strictly necessary. |
|
|
![]() |