Re: Redirection

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

 



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()
  {
    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.


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


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux