DIY three-step counter creation (below)

Source: Internet
Author: User

In this article, I will show you how to place Oso counters on your image site. I will introduce you to the idea of creating your own free counter system, Program You have to write it yourself.
Many websites provide the free counter service. A long time ago, I had a dream of building my own free counter system. Now Oso provides a database, which will become a reality.
Most websites only provide free counters to Members. We can also do this so that our website has some subjects. When they register, they can automatically generate an ID, our counter system depends on this ID!
When a user applies for a counter, the user name and password are checked first. After successful login, the user ID is called out from the database. After the user applies, the system automatically creates two files, countid. PHP and showid. PHP:
$ Filea = "count". $ id. "php ";
$ Fileb = "show". $ id. "php ";
$ FPA = fopen ("count/$ filea", W );
$ FPB = fopen ("show/$ fileb", W)
Then write the file. The content is similar to the content in the previous article. You only need to change the num. The simple process can be as follows:
Fputs ($ FPA, $ count, strlen ($ count ));
Fputs ($ FPB, $ show, strlen ($ show ));
$ COUNT = content in countid. php;
$ Show = content in showid. php;
In this way, the countid. php and showid. php files are generated, and the database can be inserted with num = ID. Finally, a section is returned. Code To let the user know how to use this counter, everything is done!
However, I think that when applying for a counter, you can set the initial value. When inserting num in the database, replace it instead of insert. If you forget the code, you can apply for a new one at any time and set the initial value, the counter will overwrite the original record, so there is no need to keep the code in mind or provide code return, which is too troublesome!
How is it? Everything is easy. I hope you can use these three articles Article We wish you a successful counter system!

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.