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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:08:30+00:00 2026-06-06T18:08:30+00:00

Let’s say that there are two PHP functions. function first() { $keyword = $this->input->post(‘keyword’);

  • 0

Let’s say that there are two PHP functions.

function first()
{

     $keyword = $this->input->post('keyword');

     //search for the result and show it to users.
     $this->search->search($keyword);

     //send the keyword to save it into the db.
     $this->second($keyword);
}


function second($keyword)
{
      //saving a search keyword in the db
}

I would like to send the result as soon as possible and save the search word into DB.

However, I want to run the second script later after specific time.

because I want to deliver the search result as soon as possible to my customer.

Is there a way to run second PHP script after a user run the first PHP script?

* I don't want to use Cron Job
* I wanna run those two script separatly. 
* don't want to use sleep because it will stop the first script for certain times.
  • 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-06T18:08:33+00:00Added an answer on June 6, 2026 at 6:08 pm

    You’ll need to route it back round to your server, but this asynchronous php approach works quite nicely (I’ve been using it for about a year to do almost exactly what you seem to be doing).

    See: How to run the PHP code asynchronous

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

Sidebar

Related Questions

Let's say we have this code: <form action='' method='POST' enctype='multipart/form-data'> <input type='file' name='userFile'><br> <input
Let's say there is a graph and some set of functions like: create-node ::
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Let's say I have multiple requirements for a password. The first is that the
Let's say that I have a set of relations that looks like this: relations
Let's say I'm writing a PHP (>= 5.0) class that's meant to be a
Let's say we have a table that has 2 million rows. It has two
Let me explain best with an example. Say you have node class that can
Let's say that I have a SQLite database that I create in a separate
Let's say I have a sortable list like this: $(.song-list).sortable({ handle : '.pos_handle', axis

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.