[PHP] PHP redirects (was Re: [PHP] Advanced. Trapped in architecture.)
AFAIK, ASP does output buffering by default (meaning it doesn't send the code to the browser until the page is fully parsed and ready to send to the client) That's what allows it to response.redirects after headers have been generated. Cold Fusion is the same way. However, once the actual HTTP headers have been sent to the client, I don't believe it's possible to do a server-side redirect -- only client-side. Someone please correct me if I"m wrong. So, PHP does have this feature if you have output buffering turned on. And not being able to do it without output buffering is more of a limitation of the HTTP protocol than it is a limitation of PHP. --kurt On Friday 26 October 2001 12:15, you wrote: > I know in ASP it's as easy as doing: > > Response.Clear > Response.Redirect > > But PHP doesn't seem to have that feature. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Advanced. Trapped in architecture.
Response.Clear Response.Redirect Doesn't that imply that ASP buffers the output? The problem with redirecting the browser after you output data isn't a PHP issue, it's the HTTP spec. I think the best solution would be to turn on output buffering, then immediately flush the output buffer when you figure out that you aren't going to be redirecting the user. -Original Message- From: Mike Eheler [mailto:[EMAIL PROTECTED]] Sent: Friday, October 26, 2001 3:15 PM To: Andy Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Advanced. Trapped in architecture. I know in ASP it's as easy as doing: Response.Clear Response.Redirect But PHP doesn't seem to have that feature. My best suggestion would be to try and re-work your code so that the redirect can be detected *before* any html code is written to the browser. Mike Andy wrote: >Hi there, > >I have a serious problem in my programming architecture. > >The architecture looks like fusebox (those of you familar with CF might now >this a.) The point is, that I am sending html code at the beginning. Body >tag and so on. Now there is the content. And inide this content there might >be anywhere an if statement. This if statement should be able to redirect to >another Page. I tryed this with the header location statement. Which workes >fine as long as output buffer is on. >Having output buffer on leads to extreme performance loss. During db access >you see a blank screen for seconds. > >Here is the question: How do I redirect to another page in this case. JS >might be a solution. But I really would like to avoid to be dependend on the >activation of JS in such a elementery decision. So... how do you guys >redirect to other pages? Might be a quick run for you guys, but I am totally >stuck here. > >Thanx for any help > >Cheers Andy > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Advanced. Trapped in architecture.
I know in ASP it's as easy as doing: Response.Clear Response.Redirect But PHP doesn't seem to have that feature. My best suggestion would be to try and re-work your code so that the redirect can be detected *before* any html code is written to the browser. Mike Andy wrote: >Hi there, > >I have a serious problem in my programming architecture. > >The architecture looks like fusebox (those of you familar with CF might now >this a.) The point is, that I am sending html code at the beginning. Body >tag and so on. Now there is the content. And inide this content there might >be anywhere an if statement. This if statement should be able to redirect to >another Page. I tryed this with the header location statement. Which workes >fine as long as output buffer is on. >Having output buffer on leads to extreme performance loss. During db access >you see a blank screen for seconds. > >Here is the question: How do I redirect to another page in this case. JS >might be a solution. But I really would like to avoid to be dependend on the >activation of JS in such a elementery decision. So... how do you guys >redirect to other pages? Might be a quick run for you guys, but I am totally >stuck here. > >Thanx for any help > >Cheers Andy > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Advanced. Trapped in architecture.
Hi there, I have a serious problem in my programming architecture. The architecture looks like fusebox (those of you familar with CF might now this a.) The point is, that I am sending html code at the beginning. Body tag and so on. Now there is the content. And inide this content there might be anywhere an if statement. This if statement should be able to redirect to another Page. I tryed this with the header location statement. Which workes fine as long as output buffer is on. Having output buffer on leads to extreme performance loss. During db access you see a blank screen for seconds. Here is the question: How do I redirect to another page in this case. JS might be a solution. But I really would like to avoid to be dependend on the activation of JS in such a elementery decision. So... how do you guys redirect to other pages? Might be a quick run for you guys, but I am totally stuck here. Thanx for any help Cheers Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]