Page 1 of 1

Redirection?

Posted: Fri Apr 07, 2006 5:56 am
by t-cat
feyd | Thread split from unrelated topic

Hi all!

This seems to be the most relevant post for my question, if not please 'redirect' me. :)

I have a long script that runs when a users submits the page, I want to redirect the user to a confirmation page, even though the script is still running.

The script is set up so that if the user closes the browser, or goes elsewhere after submission, the script carries on running. Currently, if they stay on the page, they have to wait for the script to finish.

Any ideas on getting around this?

Posted: Fri Apr 07, 2006 6:04 am
by ed209
What is your script doing that takes so long? How can you give them a confimation page before you know the outcome of the that script?

Posted: Fri Apr 07, 2006 6:17 am
by t-cat
The script is a mass mailing script for a newsletter.

The script works, even when the browser gets closed off. I just need to dislay a notification that lets the user know that they can carry on their business.

Posted: Fri Apr 07, 2006 7:46 am
by feyd
Have the mailing script update a status of sorts (or this "monitoring" script build the status information). Don't directly access the mailing script. If anything, this is a job best suited for cron.

Posted: Fri Apr 07, 2006 9:01 am
by t-cat
Sorry bout the thread, I don't post much but I'm learning :oops:

Anyway, cron is the closest thing I've come to a solution so far. Was hoping I could make an asynchronous call to a script, to run the script and display a message at the same time. All my research into this matter has turned up fruitless results.

Maybe I'll just have to go with the cron solution.