Jump to content

continue calculation after header(location)


elana

Recommended Posts

My web server runs on apache/Linux.

It collects data from users (using a form), process it, does some calculations using external scripts and programs. The output is displayed using links given from an HTML which is created during the php's run.

 

The Output HTML is created at the very beginning, and includes a "refresh" tag.

During the processing and calculation, messages are written to that HTML, so the user is updated with the server's progress.

 

Now, what I wish to do is : as soon as the HTML is created, redirect the user to this page, and contine with the php script .

BUT - this doesn't work. What happens is that only when the calculation is finished - the page is redirected. until than the user just remains on the openning form, getting the annoying "I'm thinking" icon.

I realized header("Location...") has to be followed by exit(), but it my case - I can't exit! I want to contniue calculation!

I thought about forking - the child process will do header("Location...") and exit, while the parent process will continue calculation. But than I get the Fatal error: Call to undefined function pcntl_fork() , which I understand has to do with the fact that the php is in apache.

 

Any ideas?

I read that I should try to recompile php with --enable-pcntl  , but I don't know if this is good when working with apache. Will it effect anything else? I'm working on a Linux server that does lots of other php tasks (such as wiki) apart from my server.

 

Thanks ! !

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.