| Webmaster-Showcase.net | WebHosting Counter/Stats System | ||
How the Yahoo! Webhosing Counter worksSome HTML code must be on a page to allow the Yahoo! WebHosting counter/stats system to count and collect other statistics. Other HTML code is required to show the counter Collecting the dataThe counter does the counting by making a request to visit.webhosting.yahoo.com. Code like this
<!-- Counter/Statistics -->
is automatically appended to normal HTML files served by WebHosting servers. The statistics collected by the "visit.webhosting.yahoo.com" server may be viewed by the owner of the web site using http://webhosting.yahoo.com/stats Showing the countYou can show how many hits a particular page has had by placing this code on the page:
<img src=http://visit.webhosting.yahoo.com/counter.gif alt="Counter"/>
If you want to control how the counter looks you need to use the WebHosting counter setup procedure. How to use the WebHosting counter on PHP pagesThe Yahoo! WebHosting servers only append the counter collection code to HTML files. For PHP files you must do it yourself! Again, you must collect the statistics, then you may show a count Collecting the data
To collect the data, you must place the code shown above somewhere in your PHP script. This may be done several ways:
The first two methods are obvious. The third method requires a separate file, for example "footer.html" containing the visit server access code as shown here:
<!--counter--><br />
This file is invoked somewhere in you PHP script using 'include("/footer.html")' The fourth method is similar but you don't have to put the PHP include command in each PHP file; the footer file will automatically be appended. The WebHosting PHP implementation sets the "auto_append_file" name to be "common_footer.inc". Showing the countShowing the counter is the same as shown above.
This page has been viewed
Of course the IMG SRC code may be in a plain HTML section of your PHP script or you may use the PHP write command to output it. Don't forget, if you want to control how the counter looks, use the WebHosting Counter set-up procedure. | |||
| Home |
Show Me How | Feedback |
||
| Last updated: Tue Feb 12 16:53:54 2008 | ||||