Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing a PopUp (again!)

Status
Not open for further replies.

david6633

Programmer
Jul 28, 2003
39
GB
I am trying with various amounts of success to open a popup window from within a php script when a user logs in and then to close it when they log out.

So far I can open the window with this code
Code:
echo "<script language=\"JavaScript\">newwindow = window.open('./myfile.php', 'newwindow', 'height=400, width=200, left=2000, top=500, toolbar=no, menubar=no, directories=no, location=no, scrollbars=no, status=no, resizable=yes, fullscreen=no');</script>";
but I cannot seem to close the window when the user logs out. I have tried the following - all without any success
Code:
echo '<script language=\"JavaScript\">newwindow.close();</script>';
and
Code:
echo '<script language=\"JavaScript\">(newwindow && newwindow.open && !newwindow.closed) newwindow.close();</script>';

Am I trying to do the impossible? or have I missed something somewhere along the way?

David
Remember: You only know what you know
and - you don't know what you don't know!
 
No - it is on another page.

So the next question is - is there any way that I can pass the reference to the closing page?

David
Remember: You only know what you know
and - you don't know what you don't know!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top