RE: [PHP] Re: HTTP header question.
| From: | Ben Bleything | Date: | Mon, 30 Jul 2001 01:01:51 +0000 |
| Subject: | RE: [PHP] Re: HTTP header question. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-60137@lists.php.net to get a copy of this message | ||
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?
Ben
-----Original Message-----
From: Jacques [mailto:no_mail@nomail.php.net]
Sent: Sunday, July 29, 2001 5:58 PM
To: php-general@lists.php.net
Subject: [PHP] Re: HTTP header question.
"Ben Bleything" <bleythib@ucs.orst.edu> wrote in message
news:000001c11891$447271c0$0201a8c0@allegro...
> Hey all,
>
> I want to craft a header such that it seems to the page that data has
> been POST'ed to it... Here's the situation: I'm writing a login page
to
> my application, and if they log in incorrectly, I want the page to
> redisplay, but I want it to throw out an error message. I'm currently
> doing it by
>
> header("Location: login.php?failure=true");
>
> but I'd like to make it transparent. Any ideas?
>
> Thanks,
> Ben
You cannot send ANY text or html tag (even a space ) before usin header
function.
If you have to get something displayed.
I suggest to use then :
echo "<HEAD><META HTTP-EQUIV=\"Refresh\" CONTENT=\"4;
URL=login.php?failure=true\"></HEAD>";
Regards,
Jacques
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net