This thread's too long. I'm getting confused on who exactly asked the
question..

My Take on thi 

/snip
what if the code logic requires that there is some output sent to the 
browser. 
/snip

In my case I use a Refresh-redirect. I've posted my code on this on this
thread. The way I'm doing it is like this.. (logic)

The header_refresh_html will redirect to "home.php" if user is already
logged in but not before issuing a warning to the user to logout before
logging in again.

The Error msg will be display WAY.. before the refresh/redirect takes place.
(2 seconds) Maybe if through the internet it's not so great,but on my
intranet, 2 secs is long enough for the user to view the message.

====login.php========
if ( check_if_authenticated() )
{
        header_refresh_html("home.php");
        trigger_error(ERROR_USER_ALREADY_AUTHENTICATED, WARNING);
        exit;
}
else
{
        //display login form/msg
}

=========================
Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia 
DID : 03-7870 5168


-----Original Message-----
From: Pushpinder Singh Garcha [mailto:[EMAIL PROTECTED]
Sent: Friday, July 25, 2003 2:10 AM
To: Curt Zirzow
Cc: PHP
Subject: Re: [PHP] I'm really getting annoyed with PHP


hello everyone,

Can somebody tell me why meta-refresh is not preferred to do re-directs 
?
I know Javascript is browser dependent, so its undependable.

using headers in php requires that no output is sent to the browser, 
what if the code logic requires that there is some output sent to the 
browser. I am sorry if this is a repeat question because someone 
earlier did mention abt output buffering as a way around.

TIA
--Pushpinder


On Thursday, July 24, 2003, at 12:11 PM, Curt Zirzow wrote:

> * Thus wrote Pushpinder Singh Garcha ([EMAIL PROTECTED]):
>> try this,
>>
>>
>> use a meta-refresh ...
>>
>> echo "<META HTTP-EQUIV=\"refresh\"
>> content=\"3;URL=http://wherever_u_wana_go.com/hello.html\";>";
>
> This has already been discussed, and is not the preferred method of
> doing redirects. PHP can handle what he is doing just fine.
>
>
>
> Curt
> -- 
> "I used to think I was indecisive, but now I'm not so sure."
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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

Reply via email to