Yes, your last example could be I nice solution.
I need this when a user is logged out and then uses the back button or the
links in the history list again. I noticed the no-cache code in the PHP
tutorial is sometimes not working, for example when users are given less
rights in the browser's settings by the system administrator.
When the server then notices an unauthorized user is requesting for a page,
it would indeed be appropriate to send this user a clear message that he is
not authorized, instead of a silent redirect to the login page.
Thanks,
Henk
"NC" <nc@iname.com> schreef in bericht
news:11**********************@z14g2000cwz.googlegr oups.com...
Henk wrote:
I'm looking for a way in PHP to reroute the main window.
If during the build of a page in a child frame some conditions
are not met, I would like to reload a login page in the main
window, and not in the child frame.
... Note: using javascript on the client side is not an option I think.
Your best bet is to move processing of conditions out of frames
into the frameset. The frameset should check the conditions and
then, depending on the outcome, either redurect to the login page
or render the frameset.
Failing that, you can still process in frames, but display an
error message in a way that would ensure proper redirection.
For example:
echo <<<MSG
<p>Authorization failed. <br>
Click <b>OK</b> to return to the login page. </p>
<form action="login.php" target=_top>
<input type="submit" value="OK">
</form>
MSG;
Cheers,
NC