: This article mainly introduces shenmedoumeixie if you don't feel sleepy. if you are interested in the PHP Tutorial, refer to it. Hi
I did not sleep well last night. although my dream is very sweet, I cannot sleep and do not want to do scientific research...
1. jQuery
12. create a chat room
12.1 basic functions
Login;
No refreshing real-time communication;
Supports emoticon.
12.2 General Results
Login -- verification, intended to useAjax;
Chat -- php can implement specific functions.
12.3 data stream analysis
Login Page: get the user name and password for login request-return to the chat page or failure information and login page;
Chat page: requests and responses to chat content (without refreshing new data); requests and responses to online staff information; requests to send content; write chat content.
12.4 login page development
-------- Suddenly found the needAjaxBut I don't want to read it todayAjaxCome back on weekends... -----------
2. PHP static pages (1)
I. static introduction
1.1. dynamic and static pages
Dynamic: execute dynamic programs, such as php and jsp. for example, php, syntax analysis, compilation, and execution.
Static: html and other files.
1.2 page response time optimization
-- Main means
Static dynamic pages-highlights of this section;
Optimize the database;
Use server load balancer;
Use cache;
-- Static dynamic page
Scenario: some content on the page is not changed frequently;
ESSENCE: generate static HTML files (which reduces the execution steps and saves time)
Reduce the response time. it is important to reduce the burden on the server.
It is not suitable for fast updates such as Weibo.
1.3 about static settings of dynamic URLs
Http://state.com/index.php? C = play & a = index & id = 8123
Change
Http://state.com/play/8123.shtml
This process is still pseudo-static (in fact, it is still a dynamic file, but it is changed to a vest ).
1.4 PHP static
-- Pure static
Real static files generated using php programs.
It is also divided into local pure static (/local dynamic, the implementation method may beAjax) And Global pure static.
-- Pseudo-static
Converts a URL address to html-like format.
II. pure static case implementation
2.1 buffer
-- Overview
It is actually a buffer, a memory address space, used to store data.
To achieve static state, we need to expand around the buffer.
For example, the buffer in the computer system means that when there is data to be stored, you need to fully store a buffer before writing it to the disk.
-- Process
Content -- php buffer -- tcp -- terminal
-- Use
Echo 1; echo"
";
Echo ob_get_contents ();
If it is not enabled, either change php. ini or add the header file.
Ob_start ();
2.2 achieve pure static
-- Basic method
File_put_contents ()
Output_buffering ()
The above introduces shenmedoumeixie, which includes ajax content, and hopes to help those who are interested in PHP tutorials.