Jump to content

Recommended Posts

Hey all,

 

I am trying to make it to where when the Log Out link is clicked, it logs the user out, closes the popup window (where the link is) and redirects the parent window to the login page. Here are my codes right now:

 

The logout function (defined in the login script):

if(@$_POST["a"]=="logout" || @$_GET["a"]=="logout")
{
if($auditObj)
  $auditObj->LogLogout();

session_unset();
setcookie("username","",time()-365*1440*60);
setcookie("password","",time()-365*1440*60);
header("Location: login.php");
exit();
}

 

The logout link (found in the popup window page):

<A class=tablelinks href="login.php?a=logout">Log 
out</A>

 

The javascript for the popup window, found in the parent window page:

<script language="JavaScript">
<!--

function Window() {
    window.open("popup.php", "Window", "menubar=no,width=1200,height=550,toolbar=no, resizeable=yes, scrollbars=yes");
}

 

 

Would it be a matter of inserting the echo "<script....."; to put the close window function inside the PHP logout link code? I'm not sure what the best way to do it is, or if it will even work. Thanks for any help.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.