Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 08-04-2009
Member
 
Join Date: Nov 2008
Posts: 159
Problem with close window in PHP

I have a little trouble here...

In fact in my program there is a log using an ID, if the identifier is an administrator identifier then I open another window with the main page with one frame left menu and the right page. So far so good, but I put a button "Logout" to leave the admin mode and return to the login page, but I was not able to close this window ...

Here is the code that opens the new window:

PHP Code:
<script language"=JavaScript"
function 
OpenWindow()
{
var 
V
V=window.open("Frame.html","fullscreen","fullscreen" );
}
</script> 
and in the body called this function

PHP Code:
if ($_POST ['identify']=="admin "/* testing if the user is an admin 
{
echo 'Your identification as that \admin\well'; 
echo '<input type="button" value="Continue" onclick="OpenWindow();">'; 

in the next page (ie frame) at the bottom of the menu I have this button

PHP Code:
<form nameform action "Deconnection.php" target="zoneview"
<
input type "submit" value "Logout" 
</form
and here is the page code Deconnection.php

PHP Code:
<script language="JavaScript"
function 
CloseWindow() 
{
this.close(); 
}
</script> 
</head> 
<body> 

<H2> <b> Have been disconnected you will be redirected to the login page </b> </H2> 

<input type="button" value="Return to login" onclick= CloseWindow()> 
the concern is that the this.close () does not work. I have to try to this.close () directly into the onclick or self.close () but its not working ..

so if you have an idea to close this window.
Reply With Quote
  #2  
Old 08-04-2009
Member
 
Join Date: May 2008
Posts: 685
Re: Problem with close window in PHP

Why don't you use something like:

Code:
window. close ();
Reply With Quote
  #3  
Old 08-04-2009
Member
 
Join Date: Feb 2008
Posts: 194
Re: Problem with close window in PHP

The ideal would be
PHP Code:
var V
V=window.open("Frame.html","fullscreen","fullscreen" ); 
... 
V.close 

Or, theoretically, the following code should work:
PHP Code:
<form method="post"
<
input type="button" value="Return to login" onclick="window.close()"
</
form
Reply With Quote
  #4  
Old 08-04-2009
Member
 
Join Date: Nov 2008
Posts: 159
Re: Problem with close window in PHP

I have tried window.close in the onclick, but also in the CloseWindow () it does not work; nothing happens when I clicked

there is no error ...

I thought this may be just the fullscreen but it does not work with a "normal" window
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Problem with close window in PHP"
Thread Thread Starter Forum Replies Last Post
cannot close Logitech Webcam Help window Adisa Windows Software 2 30-12-2011 04:48 AM
Unable to close QuickTime 10 window Lyudmyla Windows Software 6 19-04-2011 10:13 AM
Close window JavaScript Jensen Ackles Software Development 6 13-05-2010 12:16 PM
Need to close All Window Aakarshan.d Operating Systems 4 12-02-2009 08:58 AM
HTML code to close window Jacek Software Development 5 12-01-2009 11:55 PM


All times are GMT +5.5. The time now is 08:45 PM.