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 8575719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:45:29+00:00 2026-06-11T19:45:29+00:00

I have a PHP file executing, which inserts entries into the database, and when

  • 0

I have a PHP file executing, which inserts entries into the database, and when a condition is met (for example, $rows>500) i want to halt the execution, and two buttons to appear.

One with the value “Continue” to continue the execution of the script from where it stopped and one with “Cancel” to delete the entries that have been inserted until now, through the script.

The problem is that i cannot think of a way for stopping the execution, displaying the two buttons and then depending to my option an action to be taken.

Do I need some Javascript and AJAX?

Thanks in advance! Any help is appreciated!

  • 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-11T19:45:31+00:00Added an answer on June 11, 2026 at 7:45 pm

    Have you tried using exit(); in the script? this exits the code, thus halting it.
    for the continue you could store the pos you were at in an session.

    $i = 0;
    while () {
    
         if ($rows > 500) {
                 echo '<div id="continueAction" class="someButton">Continue</div>';
                 echo '<div class="someButton">Cancel</div>';
                 $_SESSION['pos'] = $i;
                 exit();
         }
         // Store some value in DB here
         $i++;
    }
    

    Then with an ajax request you could start again at the spot you left off, using the stored ‘pos’ in your session..

    EDIT:
    For ajax you will need a php script and a way to call the script from your button. I would use jquery for it. since you prob already have that on your site, you can just use:

     $('#continueAction').click(function(){
          $.get('ajax/test.php', function(data) {
             $('.result').html(data);
          });
     });
    

    What this does is call the script test.php and brings back any data into a javascript variable called data.. and then it puts this data inside of the .result element.
    Depending on your type of application you would have to mess around with this a bit to get your data where you need it. but this should get you into the right direction.

    Hope this helped!

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

Sidebar

Related Questions

I have a php file which checks for login and password from users database,
I have executed my php program which requires DB.php file. While executing the php
i have a php file which stores a variable, and i need to create
I have a php file list.php <?php $arr=array('444','555'); echo var_export($arr); ?> Now I want
I have a php file which has some variables like $name1, $name2... How can
I have a PHP file which my clients will execute on their server. It
I have a PHP file which will return something like <div id=title>Add Us On
On a webserver, I have a php script that parses a .sql file (which
When I try to execute php file from browser which have a command to
I have a .jar file which has a command line interface. I want to

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.