Re: Redirection

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

 



Rasmus,

Thank you, sorted it out:

In the

<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?

Col

"Rasmus Lerdorf" <rasmus@php.net> wrote in message
Pine.WNT.4.56.0311262114470.3676@DELL">news:Pine.WNT.4.56.0311262114470.3676@DELL...
> On Thu, 27 Nov 2003, PETCOL wrote:
> > Thanks, but, what if, I've just gone through an set variables and
outputed
> > the contents of those to PHP, just to run up a SQL query, to
authenticate a
> > user.  Set another to say they are authenticated, then I want to take
the
> > user to another page?  What PHP method would I use in this case.
>
> If you output anything to the user you can no longer do an HTTP redirect
> by the very definition of how things work.  You could do a Javascript
> timed redirect, but if you output something for the user to see are you
> really going to suddenly change the page on them without giving them a
> chance to read it?  Normally that is considered very bad UI design.
>
> -Rasmus

-- 
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