Re: Redirection
| From: | Donatas | Date: | Thu, 27 Nov 2003 13:50:56 +0000 |
| Subject: | Re: Redirection | ||
| References: | 1 2 3 4 5 6 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-22224@lists.php.net to get a copy of this message | ||
Another solution would be to use output buffering.
read the manual on ob_start ();
Cheers,
Donny
Stuart wrote:
PETCOL wrote:<header> <script language="javascript1.2"> function browserRedirect() {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">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?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.