PHP personal website construction overview

Source: Internet
Author: User
Here, I will exchange my personal website construction experience with you. Sorry, please correct me! A compilation debugging environment win98 local compilation debugging is cool? First, run OmnihttpdProffesinalV2.06 and install PHP4beta3. If you understand

Here, I will exchange my personal website construction experience with you. Sorry, please correct me!
Compilation and debugging environment
Win98 local compilation debugging, cool? First, run Omnihttpd Proffesinal V2.06 and install PHP4beta3. If you know HTML better, EditPlus is recommended! Otherwise, you have to use DreamWeaver first. Connect to the database? Fortunately, MySQL also has the For WIN32 version.
2. first, a counter
Your counters are always better than others! Currently, the counter source code is always refresh for a long time, so it is a bit self-deceiving. However, let's analyze how it works. Below is a simple counter example:
   If (file_exists ($ countfile ))
{$ Fp = fopen ($ countfile, 'r ');
$ Count = fgets ($ fp, 5); $ count = 1; rewind ($ fp );
Fputs ($ fp, $ count, 5 );
Fclose ($ fp );
}
Else
{
$ Fp = fopen ($ countfile, 'w ');

$ Count = '1 ';

Fputs ($ fp, $ count, 5 );

Fclose ($ fp );

};

?>

This counter has an external number, which is called "long _ ^" when it is flushed. So how can we make the counter more realistic? PHP4 gives us a simple method, that is, to apply SESSION-level variables. When you enter the page, first check whether the COUNT in the SESSION exists and is the value you want, that is, enable is the first, and then call the counting process. after the SESSION ends, you can say to COUNT: byeBye!

But what if it is not PHP4? Do you still remember the cookie? We can assume that a person's request to your webpage within 15 minutes (or within another period of time) does not belong to a new person, so that you can make a counting process in INC, when each page is referenced, the visitor sends the visit time to the cookie at the first entry. In the future, when each page is visited, the cookie's last visit time value will be checked. In comparison, if the difference is greater than 15 minutes, it will be counted; otherwise, the time will be refreshed. (You don't even know how to use cookies, do you? Haha, we recommend a book "PHP core programming", which is in Tsinghua version. it is enough to query functions. every function has an example:-D)

However, the counter just now is unsightly. it is estimated that you are not satisfied. change the image. Make a set of 0.jpg, 1.jpg ...... 9. jpg. Didn't I just read a string? After the combined outputs, the graphic counter will not come out?

Well, the counters for individual users have been well-developed.

Three homepage message announcement, making it easier for you to update (on)
-------- Each time you add a message to the homepage and add two sentences, you have to upload all the pages. this is really not worth it! As a result, lazy people like Lanfeng thought of a permanent measure, real-time dynamic, remote governance compilation, and active protection. It can also be used as a bulletin board for virtual communities. (If you want to change it, you can take the initiative to feed your message center on the homepage .) With so many benefits, you may be forgiven.

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.