In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article focuses on "how to design a regular update program for PHP". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to design a PHP regular update program".
In retrospect, my previous idea was wrong, the execution process of the web page
Open the WEB page-load HTML code (including CSS,javascript)-execute PHP code-finish
The rough one is first understood as the above.
We all know that PHP is made into a server-side script, which has a timeout setting and can be handled by the set_time_limit () function. But this is a very good way to handle PHP code
Consume CPU resources. It is not recommended to do this by looping through the PHP code.
The general situation is to use javascript to deal with.
The copy code is as follows:
$(function () {)
Var tims = 1000 "60" 60 "10; / / set the delay processing time, which is 10 hours.
SetInterval (function () {
/ / Code to be executed
$.post (". / data.php", {postdata}, function (datas) {
If (id.data = = 1)
{
$("body") .append (id.info+ "")
}
});
}, tims)
}, json)
The above is the javascript code to be executed by the WEB foreground, which delays the execution of ajax to achieve the effect of automatic processing.
Php background processing code, it is simple, as long as accept the data from the foreground POST. Then the data is stored in the database after processing.
It's that simple, but the page can't be closed, which you can understand as the background program of the software.
In fact, a software is divided into: front end, back end, server side. Both the front end and the back end run on your computer.
Tencent software daemon
The daemon can only be monitored through the task manager, but what does it do? You have no idea.
QQ can only get the cookie if it can steal your privacy like a worker bee.
At this point, I believe you have a deeper understanding of "how to design PHP regular update program". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.