PHP reverse AJAXServerPush tutorial

Source: Internet
Author: User
Please help me (I checked this item just now, it should be called ServerPush). The main purpose is to [control PHP] refresh itself after changing the database content, [display PHP. In the past, I used to [display PHP] to constantly refresh and retrieve a value from the database as include other files... please kindly help me (I checked this item just now, it should be called Server Push). The theme is:

[Control-side PHP] refreshes itself only after the database content is changed.

In the past, I used to [display PHP] to constantly refresh and retrieve a value from the database as the file name to include other files. In this way, I can use [control PHP] to change the database, to control the pages included in [display PHP], so as to update the [display PHP] content in real time.

The requirement is that an include page contains several seconds of animation (some pages have animations, some pages do not, therefore, you cannot solve this problem by changing the scheduled refresh time in a unified manner. Therefore, the server must send a message (that is, the value retrieved from the original database) to the [display PHP ), if the value received by the [display PHP] is different from the one just received, the value is used as the file name of the include statement. If the value is the same, you do not need to actively refresh the database (because you can control [control PHP], you can make [control PHP] modify the database after the animation is completed, to refresh the [display PHP ).

Thank you for your advice! Thanks for the complete set of simple examples!

Reply content:

Please kindly help me (I checked this item just now, it should be called Server Push). The theme is:

[Control-side PHP] refreshes itself only after the database content is changed.

In the past, I used to [display PHP] to constantly refresh and retrieve a value from the database as the file name to include other files. In this way, I can use [control PHP] to change the database, to control the pages included in [display PHP], so as to update the [display PHP] content in real time.

The requirement is that an include page contains several seconds of animation (some pages have animations, some pages do not, therefore, you cannot solve this problem by changing the scheduled refresh time in a unified manner. Therefore, the server must send a message (that is, the value retrieved from the original database) to the [display PHP ), if the value received by the [display PHP] is different from the one just received, the value is used as the file name of the include statement. If the value is the same, you do not need to actively refresh the database (because you can control [control PHP], you can make [control PHP] modify the database after the animation is completed, to refresh the [display PHP ).

Thank you for your advice! Thanks for the complete set of simple examples!

After refreshing, the page address is included in cookies or sessions. After each address is obtained, compare it with it. If it is the same, it will not move. If it is different, it will be refreshed.

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.