How to execute a program in the background?

Source: Internet
Author: User
Dear Gods, After the user enters the 1.php page, executes two programs A and B, because A's execution time is relatively long, does not have the influence to the subsequent operation, but the B program is relatively simple, and after execution will jump to 2.php, I hoped realizes after the user enters the 1.php, executes the B program first, then jumps to the 2.php; 。 Can it be achieved? Thank you, great God!


Reply to discussion (solution)

1. PHP Multithreading
2. PHP Pseudo-Threading
3. Ajax Async

The first, the second type of Baidu to know, the first one of the more trouble, the principle is to separate different threads or process colleagues to access the two code snippets, by return value to jump

B
Header (' location:2.php ');
A

Thank you to the two gods, but why do the ideas differ so much? I can understand xuzuning ideas, single do not know Xuzuning, your program, to ensure that a program can execute, and does not affect my execution B program and jump to 2.php? Thanks again!!!

Thank you two teachers!!!

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.