DIY three-step counter creation (in progress)

Source: Internet
Author: User
Create a counter DIY three-step (medium) this article will introduce how to add your own counters on your own image site.
Assume that you have multiple image sites as an example. first, insert several new data num and visited into the data table, which will be used on your image site, change count1.php in the previous article.
Create a folder named count and put the count2.php, count3.php, and so on ......, For example, change count1.php:

$ Linkptr = mysql_pconnect ("localhost", "yourname", "password ");

Mysql_select_db ("yourname", $ linkptr );
Mysql_query ("update counter
Set visited = visited + 1 where num = 2 ", $ linkptr );
$ Result = mysql_query ("select visited
From counter where num = 2 ", $ linkptr );
List ($ counter) = mysql_fetch_row ($ result );
$ Counter = sprintf ("% 05d", $ counter );

For ($ I = 0; $ I <5; $ I ++ ){
$ Tmpstr = "";
Echo $ tmpstr;
}
?>
Note: "After this step is completed, create a folder show, and put the corresponding file show2.php in it,
Show3.php ......, Take show2.php as an example. write the source code as follows:

Document. write (" ");

Note: Don't forget to add two points before count. this is the complete path!
Finally, place the code in the appropriate location on your image site:

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.