php-windows | 2003112
Date: 11/27/03
- Next message: Lawrence: "[PHP-WIN] Code to splite page"
- Previous message: PETCOL: "Re: [PHP-WIN] Redirection"
- In reply to: PETCOL: "Re: [PHP-WIN] Redirection"
- Next in thread: Donatas: "Re: [PHP-WIN] Redirection"
- Reply: Donatas: "Re: [PHP-WIN] Redirection"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
PETCOL wrote:
> <header>
> <script language="javascript1.2">
> function browserRedirect()
> {
> var ns4 = document.layers;
> var ns6 = document.getElementById && !document.all;
> var ie4 = document.all;
>
> if(ns4) URLStr = "http://www.php.net";
> else if(ns6) URLStr = "http://www.php.net";
> else if(ie4) URLStr = "http://www.php.net";
> else URLStr = "http://www.php.net";
> location = URLStr;
> }
> </script>
>
> </header>
>
> In the
>
> <body>
> echo "<script language='javascript'>\n";
> echo "browserRedirect()\n";
> echo "</script>\n";
> exit();
> </body>
>
> You might have a better cleaner suggestion?
If you're going to go this way (which as Rasmus pointed out is generally
very bad UI design) you might find the following a lot cleaner...
<script language="javascript">
location.href = 'http://www.php.net/';
</script>
There is no reason to do any browser detection, especially if you don't
actually change anything based on what browser it thinks it is. The best
solution however would be to reorganise the script so it decides whether
to redirect before it outputs anything to the browser.
-- Stuart-- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Lawrence: "[PHP-WIN] Code to splite page"
- Previous message: PETCOL: "Re: [PHP-WIN] Redirection"
- In reply to: PETCOL: "Re: [PHP-WIN] Redirection"
- Next in thread: Donatas: "Re: [PHP-WIN] Redirection"
- Reply: Donatas: "Re: [PHP-WIN] Redirection"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

