Home  >  Article  >  Backend Development  >  Should the web page use html or php?

Should the web page use html or php?

王林
王林Original
2019-09-09 13:32:454818browse

Should the web page use html or php?

First of all, whether it is html or php, although they are two different languages, they can both write web pages. The difference is that web pages written using HTML are purely static web pages, cannot run locally, and cannot interact with users; web pages written using PHP are dynamic, run on the server side, and can interact with users. . Whether to use html or php depends on the work requirements.

The difference between using html and using php to make web pages:

1. Functional differences

html to make web pages It's front-end, executed and rendered by the browser, and you can see the effect when you open it locally. PHP is different. It is a program that serves the back-end, runs on the server, and generates front-end code and sends it to the client (browser).

2. Status difference

Early websites were all static, that is, html. There were as many html files as there were pages, 1,000. News requires 1,000 HTML pages, while dynamic websites such as PHP require only one PHP file, so it is called dynamic. Only dynamic websites can be interactive, such as user messages.

3. Differences in language properties

(1) PHP is a server-side language. It must be run on a web server that supports PHP scripts and is interpreted by the server-side program. of. The output code of PHP must eventually be converted to HTML.

(2) The emergence of PHP is mainly to process dynamic web pages, that is, to process HTML. HTML is a markup language and can be parsed on the browser without a web server. HTML is a client language and is interpreted by the browser. Web pages made using only HTML are static web pages without any interactive functions.

The above content is for reference only!

Related video recommendations: PHP video tutorial

The above is the detailed content of Should the web page use html or php?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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