Re: Re: HTTP header question.
| From: | Philip Murray | Date: | Mon, 30 Jul 2001 01:05:54 +0000 |
| Subject: | Re: Re: HTTP header question. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-60138@lists.php.net to get a copy of this message | ||
Quoting Ben Bleything <bleythib@ucs.orst.edu>:
> I'm fully aware of that. The issue is not the refreshing (that works
> fine)...
>
> Here's a little more detail:
>
> if(!$login)
> {
> if($failure)
> // complain
>
> // show the form
> }
> else
> {
> if(user_is_good)
> // take them to the next page
> else
> // complain
> }
>
> The //complain in the else section is this:
>
> Unset($login); // so it won't try to authenticate again
> $failure = true; // so the form knows to complain
> header("Location: login.php");
>
> Okay. So, just to clear things up, I'm not sending anything before
> this. This happens IMMEDIATELY after the user clicks on Submit...
>
> What I'm looking for is a way to do this such that the user does not see
> anything more than http://host.name.here/rams/login.php in
> their address
> bar when it failed... doing it the way I show above does not work, and
> the alternative ( header("Location: login.php?failure=true") ) does not
> satisfy my requirement.
>
> So... anybody else?
> -
How about using javascript?
For example
<form name="loginFailure" action="login.php" method="POST">
<input type="hidden" name="failure" value="true">
[...any other data you want...]
</form>
<script language="Javascript" type="text/javascript">
<!--
document.forms[0].submit()
// or document.forms['loginFailure'].submit();
// -->
</script>
It's untested, but you get the idea.
Cheers
--
-------------------------------- - -- - - -
Philip Murray - webmaster@open2view.com
http://www.open2view.com - Open2View.com
------------- - -- - -