RE: [PHP] I'm really getting annoyed with PHP
| From: | Ow Mun Heng | Date: | Fri, 25 Jul 2003 01:48:10 +0000 |
| Subject: | RE: [PHP] I'm really getting annoyed with PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-156779@lists.php.net to get a copy of this message | ||
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:pgarcha@adelphia.net]
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 (pgarcha@adelphia.net):
>> 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
>