Http: // localhost/index. php? Action = newslist
| 1. <? PHP require (... The public function library will be loaded here...)?> |
| 2. <? PHP Include ("Top. php")?> // Create a top. php file to parse the website header.
What is the header?
Is <HTML>
<Head> ...... </Head> content here. Here we will process the common elements and custom display titles or load different scripts. |
| 3. The content template to be displayed should be loaded here.
For example, if I create a newslist. php file (Note: This file does not contain the head or body mark and is directly displayed as a naked service content), the Code is as follows:
<Body>
<Div id = "out"> // a DIV at the outermost layer controls the basic width and style of the page.
<? PHP Include ($ _ Get ["action"]. "php")?> // You can load different pages based on different parameters.
Of course, you need to make some judgments during the actual operation, such as whether the file exists or not.
</Div>
// Newslist. php should be directly <ul> or <div> or <DL> to display business data
// Of course, other user-defined functions such as require can be continued in newslist. php. |
| 4. <? PHP Include ("bottom. php")?> // Create a bottom. php file to parse the website's tail.
Note that this file must contain the </body> mark.
|
| |
So any page access mode is index. php? Action = XXXXX
So your website is already in Plug-In mode. (Just preliminary)
If you use 301 redirection or the Apache. htaccess file, the use of pseudo-static page addresses is more perfect.
Reposted: [happy to learn PhP100 days] day 6: Go to the PHP fun page (basic)