Redirection?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
t-cat
Forum Newbie
Posts: 12
Joined: Fri Apr 07, 2006 5:40 am
Location: South Africa

Redirection?

Post 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?
User avatar
ed209
Forum Contributor
Posts: 153
Joined: Thu May 12, 2005 5:06 am
Location: UK

Post 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?
User avatar
t-cat
Forum Newbie
Posts: 12
Joined: Fri Apr 07, 2006 5:40 am
Location: South Africa

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
t-cat
Forum Newbie
Posts: 12
Joined: Fri Apr 07, 2006 5:40 am
Location: South Africa

Post 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.
Post Reply