Create counter DIY three-step (bottom) _php Foundation
Source: Internet
Author: User
Medium I introduced to you how to put the counter on the Oso on your own mirror, this article I will introduce you how to build your own free counter system concept, the program also have to write yo yourself.
Many websites offer free counter service, I have a dream long time ago, set up own free counter system, and now Oso provides the database, all this will become a reality.
Most sites are only to provide free counters to members, we can do so, so that their own site also has some subjects, in their registration, you can automatically generate an ID, our counter system depends on this ID!
When users apply for counters, the first of course is to check the user name and password, after the successful landing, from the database to pull out the user ID, the user application after the system automatically create two files countid.php and showid.php, the simple process can be as follows:
$filea = "Count". $id. " PHP ";
$fileb = "Show". $id. " PHP ";
$FPA =fopen ("count/$filea", W);
$FPB =fopen ("show/$fileb", W)
Then write the file, content and medium the same, only to change the NUM, the simple process can be as follows:
Fputs ($FPA, $count, strlen ($count));
Fputs ($FPB, $show, strlen ($show));
The contents of the $count =countid.php;
The contents of the $show =showid.php;
This produces the countid.php and showid.php two files, at the same time let the database insert Num=id on it, and finally returned a piece of code, so that users know how to use this counter, all done!
But I think when the application counter can let the user set the initial value, the database inserts NUM use replace instead of insert, so that if the user forgets the code, at any time can reapply for a, and set a good initial value, and counter will be the original records covered, it is unnecessary to let users remember the code, or provide code to return, this is too troublesome!
What do you think? Everything is easy, I hope you can through these three articles successfully build their own counter system, here I wish you success!
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