NYCPHP Meetup

NYPHP.org

[nycphp-talk] send header before end of script?

David Mintz dmintz at panix.com
Fri Oct 24 17:46:35 EDT 2003


On Thu, 23 Oct 2003, Analysis & Solutions wrote:

> Stephen:
>
> On Thu, Oct 23, 2003 at 05:38:37PM -0400, Stephen Musgrave wrote:
>
> > ignore_user_abort and I would like to send the a confirmation screen to the
> > user that tells them that, "the process has been started and it will be
> > completed in 2 hours."  But from what I can tell, sending the header
> > redirect to the confirmation page aborts the execution of the script.
>
> The simple way is to send them to a confirmation page.  Just print out the
> confirmation on the original page when the process is done.  You can use
> the output buffering functions to get the initial "be patient" message.
> You can also use it to spit out a list of emails sent along the way, if
> you like.  Then, when it's completed, echo that fact out to the browser.



I'd love to see a little tutorial or something on How To Do That. I've
tried it playing around with output buffer functions and I encountered
that familiar phenomenon know as "it doesn't work" (This, in a shared
server situation where there are some php.ini things I can't set)

I did buy Shiflett's book (wow, can't wait for the movie to come out!) and
it seems you can do cool tricks at the protocol level with the
"Transfer-Encoding: chunked" header, spitting out chunks as you go along
(although I've yet to try it), but I wonder how one does it in "pure" PHP
with the buffering functions.

As chance would have it, my scenario is similar to Stephen's -- I'm
sending a message to a bunch of addresses. No more that about 150 or so
for now but it would be nice if this script could (...dare I use the
S-word?) scale up well, and this technique of outputting the page as the
process goes along would help..


---
David Mintz
http://davidmintz.org/
Email: See http://dmintzweb.com/whitelist.php first!

	"Anybody else got a problem with Webistics?"

		Sopranos 24:17



More information about the talk mailing list