Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7930477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:26:16+00:00 2026-06-03T20:26:16+00:00

I have a script that requires ~5 minutes to execute and complete. Everything takes

  • 0

I have a script that requires ~5 minutes to execute and complete. Everything takes place on one PHP page (includes, but no AJAX or anything). When the script completes, you’re emailed a file.

What I would like is for the front end to simply accept the form submission and do it’s thing behind the scenes, while pushing information through if the window remains open.

So, for instance, here would be the flow:

  1. Fill out a form and submit.
  2. Page confirms the form was submitted – free to close the window.
  3. If the window remains open, give ‘milestone’ updates
    1. Query finished
    2. File generated
    3. Email sent

The goal would be to provide information if the user waits for it, but closing the window immediately after the form submits is perfectly acceptable and the email will still be received. I know I can submit the form via AJAX, but how can I pass back interim process completions rather than just a success callback?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T20:26:18+00:00Added an answer on June 3, 2026 at 8:26 pm

    You’ll have to have the client (the browser) poll the server on regular intervals for updates. For example, you might have something like the following:

    function checkStatus() {
        $.ajax( {
            url: "/CheckStatus",  // your AJAX handler, on the server
            success: function(data) {
                $('#status').text( data );
                if( data != 'Email sent' )
                    setTimeout( checkStatus(), 100 );
            }
        } );
    }
    

    Then, after your form is submitted, simply call checkStatus.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script that is symlinked from one folder to another /var/www/default/index.php which
I have a Perl script that requires two command line arguments that takes a
I have a Perl script that requires a couple of plugins, for istance nmap.
We have a script that saves some rows in a table and one of
I have a Matlab script that requires a function in a DLL, and calls
I have a file that is a bash script that requires SUDO to work.
I have a script/program I am working on that requires a configuration file (I
I have cron job - php script which is called one time in 5
I'm working on a script that requires me to have an array with a
I have a script that requires the postcode input to have a space in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.