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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:42:12+00:00 2026-06-08T06:42:12+00:00

I have a signup form that calls a PHP script which can interact with

  • 0

I have a signup form that calls a PHP script which can interact with our CRM’s API, like so:

CRM API <–> PHP script <–> Signup form

  1. The signup form passes some information to the PHP script in one
    AJAX call
  2. The PHP script run a dozen API calls to the CRM to create
    an account and attach various data
  3. The CRM returns the new account id it just created to the PHP script
  4. The PHP script passes the account id back to the signup form, at which point the AJAX call is complete and the signup form can continue.

The problem is #2, those dozen calls take about 20 seconds to complete, but the data the signup form needs is generated after the first API call so it could in theory return that data much sooner and do the rest of the stuff server side without holding that AJAX call open the whole time.

I tried flush() and ob_flush() which does output account id to the client before processing is complete, but the jQuery AJAX connection remains open so I’m still stuck waiting for the connection to be closed on the signup form side before anything happens.

So what’s the easiest route for returning that account id to the form as fast as possible?

Maybe break out using curl and exec?

 if(signing up){
      stuff
      exec(curl myself, notsignup)
 }
 else {
      bunch of api calls
 }
  • 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-08T06:42:13+00:00Added an answer on June 8, 2026 at 6:42 am

    You should probably think about creating a seperate process for the rest of the steps that are needed. One way is that you could after the #1 first api calls has been completed. It responds back to the user, and doesn’t try to complete the rest of the 20 calls on the user side.

    Then create a queue that will finish the rest. You could always create a table in mysql to store the queue.

    Next just create a cronjob that will run in the background, knocking the queue out.

    Note: You will not want this cronjob to just start and never stop. Maybe have it run every 5 minutes, but before it starts to run, check to see if another cron is still in progress. If it is then it will check in another 5 minutes to see if it is ok to run.

    Hope this helps!

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

Sidebar

Related Questions

I have a signup button that switches screens for a signup form. I'd like
I have a form (signup.php) that pops up in a nyroModal window when I
let's say I have index.php . It has a form that POSTS to signup.php
I have signup form that posts all variables to signup.php. What I want to
I have a problem. The client is claiming that a prize signup form I
I have a long signup form and would like to hide a few fields
I have a form allowing a user to signup for a news letter which
I have to integrate a 3rd party newsletter signup form that makes an AJAX
I have a signup form where I'm validating user input. Here's my controller: <?php
I have a simple user signup form with a checkbox that lets users get

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.