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, 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 SyntaxHighlighter. all ();
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, 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!