Re: redirection with PHP and closing windows?
| From: | -{ Rene Brehmer }- | Date: | Wed, 21 Apr 2004 13:49:33 +0000 |
| Subject: | Re: redirection with PHP and closing windows? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-184123@lists.php.net to get a copy of this message | ||
According to historical records, on Tue, 20 Apr 2004 23:02:50 -0500 Andre
wrote about "[PHP] redirection with PHP and closing windows?":
>I want to be able to process a PHP script and then if successful redirect to
>another page. Is there a good way to do this with PHP or do I need to stick
>to Javascript?
I always use META redirects for this (trying to avoid anything but PHP
whatever it takes) ... but I believe there are other ways ...
>Also, is it possible to close a window that is running a .PHP page via a
>link or again, just stuck with Javascript?
I don't think it gets any simpler than the JavaScript:
// method 1
<a href="javascript:window.close()">Close window</a>
// method 2
<a href="#" onClick="window.close()">Close window</a>
Not entirely sure how cross-browser compatible this is. May have to use
this.window.close() or windows.close(this) ... I can't remember the exact
syntax, sorry, haven't worked much with JavaScript except for mouseovers in
several years....
Rene
--
Rene Brehmer
aka Metalbunny
~ If you don't like what I have to say ... don't read it ~
http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/