Home > Backend Development > PHP Tutorial > Simple page buffering technology (3)_PHP tutorial

Simple page buffering technology (3)_PHP tutorial

WBOY
Release: 2016-07-20 10:59:38
Original
906 people have browsed it

​ The content.php3 file is used to handle dynamic pages. Users can read a data file through content.php3?page=id number. I won’t go into the specific method. As long as you know that each data file has a different ID number, the method content.php3?page=id number can uniquely identify a data file.

Lines 1-3 generate temporary file names. Replace '?', '&' and other characters with '_'.
Line 4 determines whether the temporary file name exists. If so, execute lines 18-22 and end.
Lines 6-13 determine which of the file modification time and temporary file related to generating dynamic pages is updated, and set the regeneration flag. Use filemtime() here to get the last modification time.
Lines 24-41 use template classes to generate dynamic results and place them in variables. Regarding the processing of templates, please refer to the article "Template, PHPLIB Processing Method".
Lines 43-50 generate temporary files. The file is locked here to prevent write conflicts.
Line 51, output the results.

This is how I handled it, you can modify it yourself.

Buffering is a meaningful technology that can improve access speed and reduce system consumption. However, there may be many methods, and everyone is free to use them.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445595.htmlTechArticleontent.php3 file is used to process dynamic pages. Users can read a data file through content.php3?page=id number. I won’t go into the specific method. As long as you know that each data file...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template