Create a DIY three-step guide for counters (below) _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
Create a DIY three-step counter (below ). 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, the program has to be written by yourself. I will introduce you to how to place OSO counters on your image site. in this article, I will introduce you to the idea of creating your own free counter system, you have to write the program 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, countid is generated. php and showid. php files, let the database insert num = id at the same time, and finally return a piece of 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 to create your own counter system. I wish you success!


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: 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.