Re: Window close.

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

 



On Mon, Feb 06, 2006 at 02:05:55PM -0500, tedd wrote:
> Hi:
> 
> This might seem like a odd question, but in php I can leave a script 
> by "exit;" But, how can I also close the html page that contains the 
> script?
> 
> I know that I can close the page many different ways via a user 
> actions, but how can I close it from within a conditional php 
> statement?
> 
> Thanks.
> 
> tedd
> -- 
> --------------------------------------------------------------------------------
> http://sperling.com/
> 

I've usually resorted to using Javascript:

function close_window($msg='')
{
    echo "<script language='Javascript'>\n";
    if (!empty($msg)) {
        echo "alert(\"$msg\");\n";
    }
    echo "self.close();\n";
    echo "</script>\n";
    exit;
}

-- 
Jim Kaufman
Linux Evangelist
public key 0x6D802619
CCNA, CISSP# 65668

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux