Many features of PHP in 3PHP practice are related to other software or tools. Using the PHP knowledge we have learned so far, we can try to build a simple interaction website. We can learn a lot from this process. Okay, now we have 3 PHP practices
Many features of PHP are related to other software or tools. Using the PHP knowledge we have learned so far, we can try to build a simple interaction website. We can learn a lot from this process. Well, we are now beginning to focus on the construction of a typical personal website.
3.1 plan a site
Generally, a personal site contains a welcome page, a message book page, a bookmarkdonpage, a counter, contact information, and even a collection of photos and music files. Let's start with a title page, a contact information page, and a resume page. We also need to scale the general page header and bottom.
Webpage --front.html
Here we have a very simple html file:
<BR> my personal homepage -- welcome <BR>
My personal homepage
Welcome
Welcome to my cold house, although there is nothing at the moment.
But I hope I can add more immediately.
Copyright? Me, 1999
Contact Information page --count.html
We also have a simple page:
<BR> my personal homepage -- Contact Information <BR>
My personal homepage
Contact Information
You can contact me through 1-800-PHP-INFO
Copyright? Me, 1999
3.2 HTML to PHP
As you can see above, each page has the same header and bottom. As shown in the preceding figure, each page can write the same information when the workload is low, but imagine how much effort you will spend when there are more than 100 pages and you need to change all of their headers or bottoms? How tedious and boring is manual changes on one page! Therefore, we should write PHP headers and bottom files for these pages, and then we just need to reference them in each HTML page. We will put these include files under a subdirectory named include. Next we will write the general content of these sites into the file.
General site variable settings: common. inc
// General site variables
$ MyEmail = 'phptalk @ tnc.org ';
$ MyEmailLink = '$ MyEmail ';
$ MyName = 'php Tal ';
$ MySiteName = $ MyName.'s Home Page ';
?>
General page header: header. inc
// Define the general page header
?>
<BR> <? Echo '$ MySiteName-$ title';?> <BR>