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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:36:50+00:00 2026-05-25T17:36:50+00:00

Suppose I make an AJAX HTTP Request from jQuery to a back-end PHP script

  • 0

Suppose I make an AJAX HTTP Request from jQuery to a back-end PHP script that does some querying on MySQL server. While the request is made, I want to regenerate a new request and terminate the current one on the server end.

Script front-end.php contains this:

function process(json) {
 // iterate and display result
}

google.maps.event.addListener(map, 'idle', function () {
 ....
 $.getJSON('back-end.php?id=$id&bounds=$bounds', process);
});

Script back-end.php contains this:

$id = // get current MySQL process id
// check and send request to terminate previous process if id is set
// send request to get data based on bounds criteria
echo json_encode(data);

How can I get $id onto script front-end.php so that I can terminate the previous process on the server as soon as I issue the next one?

  • 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-05-25T17:36:50+00:00Added an answer on May 25, 2026 at 5:36 pm

    You need to save this process id somewhere common to the two different requests. Something like in a text file, or db table, or memcache on the backend. So for example the first php request starts your process then writes the process id to a file such as current_id.txt. Then the second request checks this file for an id, then kills the process then blanks out current_id.txt after it is killed.

    If you need this to be replicable across many users, you have to have a way to identify it is the same person with a session variable or the session id itself, and create files like <session_id>_process_id.txt so each unique user can do this independent of each other.

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

Sidebar

Related Questions

Suppose I make an AJAX HTTP Request from jQuery to a backend PHP script.
Is it possible to make AJAX-calls (e.g. using jQuery.ajax() ) from local html/js file
Suppose you want to make an async request in JavaScript, but you want to
Suppose the jQuery object of the input is $input. How to make its value
Suppose I have an element called #container-main . How do I make that display:none
Suppose this is my URL route: (r'^test/?$','hello.life.views.test'), How do I make it so that
Suppose I have a stringbuilder in C# that does this: StringBuilder sb = new
Possible Duplicate: Run one instance from the application let's suppose i make an application
I guess what I mean is, if I make a site that uses AJAX
Suppose I do this: request.session['x'] = 33 How do I make this session variable

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.