Re: headers .vs javascript location.href

From: Date: Mon, 19 Sep 2005 14:41:03 +0000
Subject: Re: headers .vs javascript location.href
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-222665@lists.php.net to get a copy of this message
bruce wrote:
hi.. need to talk to someone to figure out how/what i need to do to use the php 'headers' function, as opposed to the javascript 'location.href'. i've tried to implement the buffering functions, but still get the same error... is there someone that i can talk to about this, who ha experience/understanding of what's going on. i've thought about rewriting what i have to this point, but i've got code interspersed with html... yeah.. i know... cleaning it up would probably make things easier/better, but this is a quick/dirty test.. and i don't claim to be a web developer! thanks -bruce bedouglas@earthlink.net
Bruce, your question lacks specificity, so it is difficult to give you a simple answer. Here is how I handle virtually of of my html pages. It solves the buffering problems and makes good, clean, and easy to debug code. This approach is good since, like buffering, it sends everything in one stream to the client. I assemble my output stream like so. Obviously, foo can be anything, variables, strings, etc. $report= ''; code or what ever.... $report .= foo; code or what ever.... $report .= foo2; and so on.... Then at the end when the report is fully assembled, I simply echo $report;

« previous php.general (#222665) next »