In fact, I am not a long time to make Web pages, but I used to use VB VC written game Assistant software, programming or understanding points;
After a period of learning, I have a certain understanding of js,php,sql,html functions, objects, and grammatical variables;
I will use PHP with SQL to extract data in MySQL;
CSS will also be used to change the interface style;
Some events will also be handled with JavaScript;
But I'm not going to connect with ...
For example, after someone has submitted a message,
I'll go back to a unique URL, like we're all in
Segmentfault.com
But my page is:
https://segmentfault.com/u/duofei/;
Yours is a
https://segmentfault.com/u/helpful good Person A/
Our homepage has our article number, the number of questions, the number of answers, and so on;
I'd like to ask, what's going on with this process?
Of course, I will use the PHP echo ". : "Out of a Web page,
But I don't think it's possible. A webpage is done with the PHP Echo, must first design good one HTML Web page, save to the server's hard disk;
Then there are JS, CSS files, also saved to the server, when you point, connect to the pre-prepared HTML file, put js,css and other files down to your computer's cache;
Then your computer to parse this HTML, the implementation of CSS style sheets and JS files, the HTML article Ah, fan ah, ask questions ah, answer ah, points ah, all feedback to you;
I want to ask, what is all this? What else do I have to learn to get a simple website on my own?
Reply content:
In fact, I am not a long time to make Web pages, but I used to use VB VC written game Assistant software, programming or understanding points;
After a period of learning, I have a certain understanding of js,php,sql,html functions, objects, and grammatical variables;
I will use PHP with SQL to extract data in MySQL;
CSS will also be used to change the interface style;
Some events will also be handled with JavaScript;
But I'm not going to connect with ...
For example, after someone has submitted a message,
I'll go back to a unique URL, like we're all in
Segmentfault.com
But my page is:
https://segmentfault.com/u/duofei/;
Yours is a
https://segmentfault.com/u/helpful good Person A/
Our homepage has our article number, the number of questions, the number of answers, and so on;
I'd like to ask, what's going on with this process?
Of course, I will use the PHP echo ". : "Out of a Web page,
But I don't think it's possible. A webpage is done with the PHP Echo, must first design good one HTML Web page, save to the server's hard disk;
Then there are JS, CSS files, also saved to the server, when you point, connect to the pre-prepared HTML file, put js,css and other files down to your computer's cache;
Then your computer to parse this HTML, the implementation of CSS style sheets and JS files, the HTML article Ah, fan ah, ask questions ah, answer ah, points ah, all feedback to you;
I want to ask, what is all this? What else do I have to learn to get a simple website on my own?
MVCFramework mode, HTML template and back-end code separation, to achieve their own operations;
To answer your question, why 每个用户在同一个界面所显示的效果(数据)不一样呢 ? In fact, it is also very simple, in the data table is different user storage information is different, and storage of this information may be composed of multiple tables. Just like everyone's homepage, take my homepage for example:
The statistics and outputs of several different chunks here are implemented in conjunction with MySQL statements, PHP code, and front-end HTML files. For example: the statistics on the left side of the picture, example: 我的回答 the number of times, perhaps in the data table has such a field, I answer each question, the data in this field will be added 1, and then when I enter this page, MySQL directly read my field value is good ( 当然,更复杂的数据统计也皆由sql语句实现,而且这些数据皆是在数据表中读取 ), and then by the PHP code in the HTML page output;
The beginning, the process, and the end are all composed of SQL statements, PHP (or other backend languages), front-end code (HTML, CSS, JS, etc.).
A Dynamic Web page is something that separates the data logic of the page from the display logic, and the display logic is quite similar to the fixed part of the HTML layout, such as the definition of a Div, where the data content such as
[there are some php echo]
So to implement the dynamic page, of course, you can also be the div echo out
You can study the thinkphp.
To put it simply, many of the details are not entirely accurate.
The fundamental principle of dynamic Web site is that the HTML file can not be stored on a hard disk file, but can be directly generated by the program, or can be modified dynamically.
For example, you visit the ' https://segmentfault.com/u/helpful good guy/' this URL
After receiving your access request, the server extracts the ' helpful good guy ' from the URL, checks the data in the database for the corresponding ID, and generates a string containing the HTML file information to fill in the data, such as
乐于助人的好人甲男,回答xx,提问xxx,声望……, the data does not need to be saved to disk, directly on the network to your browser, the browser to interpret it as a file, you see the results.
There are some of the same things, for example {{ }}{{ }},回答{{ }},提问{{ }},声望{{ }}…… , if the dynamic generation efficiency is too low each time, we can save these as a template file, so that when viewing a profile, different IDs categorize the information into the corresponding parentheses.
JavaScript can also be used to dynamically fetch data from the server and then update the HTML page after the browser has loaded the page.
I think the ultimate goal of the landlord is to write a simple website, you can start by building a server, so you can understand the agent, routing and so on, if you just want to write an accessible page, you can do code management in the Sina cloud
1. Front Page
2. Backstage Management
3. Database connection
4. Form Design
5. Form Processing
When you enter the user name password in the browser, the browser sends the data to the server, and the server-side PHP finds the user based on what you have entered, and then returns to your own page. The dynamic data returned is generated by PHP, PHP is found in the database and then placed in the HTML, the HTML of other fixed content (such as the structure of the page) is in the server's HTML file (perhaps in several different files, Then PHP integrates them with the information that is queried from the database and sends it to your browser. The browser then receives the HTML file to see which css,javascript and image files are applied, and then requests the files to the server to get the files before rendering the entire page.
What happens when you enter google.com in the browser and press ENTER?
After you know it, just say it briefly.
Like this url:https://segmentfault.com/u/duofei/.
/u/duofei/contains two parameters, the dynamic language on the server will be based on this parameter to the database query, and return the results. For example, you might be querying the user table with the user named Duofei.
Violence a little:-)
https://segmentfault.com/u/duofei/is actually a server on a function, you use the browser to open this url is to call this function , 参数 is 浏览器 sent by, and then the server and so on after the function run return value (may be html ) to you, the browser then put this html Rendered as you see it.
By the way, I omitted a lot of very important things, but one of the socket main problems needed
B/Sthe feeling is actually special (HTTP)C/S
In fact, Dynamic Web site than static site A little more things, in essence, you request some files, the server sent you some files, your browser to explain some of the files.
After you send the request, the server sends you some files before it is processed by the service-side language (PHP, JSP, etc.) .
How is it handled? Why is the SF page different for everyone?
These are based on extracting the data from the database and generating the page content based on the data. The point of the dynamic is that the data is changing . For example, you visit Xiao Ming's site, he wrote a paragraph today (log data changes), causing fan focus (change the fan data), or modify the status (State data changes), and then the server language from the database when the data, plus some logic, such as the number of fans to rank, Those with high fan level are generated to the front, and ultimately the page visited is different from the last one (because the data changed and the resulting page was different). Then the service side to send you a lump of html,css,js, your browser obediently in accordance with the rules of the display of beautiful pages, and the execution of JS code. With JS, you on the page of some real-time operation, JS will send these operational data to the server, the server returned some data, JS by these data to change some page content, the browser display. That's it.
The principle is: dynamically change the structure of the site, is to do data interaction
Dynamic Web site is actually the data of the database and the foreground user to provide a channel for interactive operation