PHP + js + html + mysql mutual pass-through program

Source: Internet
Author: User
Tags php website
Access a webpage, the server runs the php parsing program, parses php, and links mysql when mysql is used (when php parsing is completed, it is automatically disconnected). When php parsing is complete, it starts to return html, the browser starts parsing html and detects js and cs...

Access a webpage, the server runs the php parsing program, parses php, and links mysql when mysql is used (when php parsing is completed, it is automatically disconnected). When php parsing is complete, it starts to return html, when the browser parses html and detects that js and css are independent files (css and js code are mostly in html), it starts to request js and css files, specifically, the two of them requested the webpage first, which is not very sure. Presumably, in the order of html, the browser began to display the webpage when html was obtained. When css was completed, the overall display was complete, js needs to be touched.



Html is a hypertext link language and static. it is displayed on the client. only HTML-based webpages are static webpages without any interaction functions.
JS is an object-and event-driven scripting language that runs on the client and is a relatively simple programming language, the method of use is to add a script to the HTML file on the web page to make the HTML statement web page more powerful. It does not need to be compiled and explained separately. when a browser that supports JavaScript opens this page, it will read this script and execute its commands.
PHP is a programming language that runs on the server. it is mainly used to process information submitted by customers through web pages. it runs on the server side and is used to respond to customer requests.
PHP cannot exist without HTML;


HTML is not a language, but a tag. when the browser runs on the tag, it can make a relative reflection. it cannot block PHP or help PHP, but just make your webpage beautiful.
JS is a scripting language that allows your browser to make a relatively interactive response.
PHP is the programming language that responds to user requests. It is running on the server and will not be sent to the user.


If we create a PHP application, we actually create a PHP script file. Before the server sends the output information to the client, the network server takes the lead in processing the PHP language in the file. If the server does not support PHP, the network server sends hypertext files directly to the client's browser to respond to HTTP requests. if the server supports PHP, when the server responds to a php file request, it will perform the following processing: first, in a php file, the standard HTML code will be sent directly to the browser, the embedded PHP program is first interpreted and executed by the network server. For standard output, the output information will also be sent to the browser as standard HTML.

PHP can be installed in Unix/Linux or Windows. Currently, PHP + MySQL + Apache is the most widely used server policy in Unix/Linux.




2.1 How PHP works

A complete PHP System consists of the following parts.

Operating system: the operating system used by the website running server. PHP does not require the specificity of the operating system. its cross-platform features allow PHP to run on any operating system, such as Windows and Linux.

Server: The server selected when the PHP runtime environment is set up. PHP supports a variety of server software, including Apache and IIS.

PHP package: parses and compiles PHP files.

Database System: stores data in the system. PHP supports multiple database systems, including MySQL, SQL Server, Oracle, and DB2.

Browser: browse the web page. Since PHP has been compiled into other code by the parser when it is sent to the browser, PHP has no restrictions on the browser.

. 1. shows the entire process of accessing the PHP website system through a browser, so that you can better understand the relationship between them.

. 1 working principle of PHP

. 1 resolution.

(1) The PHP code is passed to the PHP package, and the PHP package is requested for parsing and compilation.

(2) the server reads the database according to the PHP code request.
(3) the server and PHP package parse the PHP code into common HTML code based on the data in the database or other running variables.

(4) the parsed code is sent to the browser. the browser analyzes the code to obtain the visualized content.

(5) The user browses the website content through a browser.


Article URL:

Reprint ^ at will, but please attach the tutorial address.

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.