You would like to add an visit counter embeded to a page of your personal web site, a simple text counter but with the ability to handle several visitors.
You can find here a solution free of use, based on a JavaScript tag that you have to insert into the HTML code of a page of your website, such a JavaScript tag calling a PHP file as an external JavaScript module. The PHP file that you have to upload to your personal host or webspace, handles the count using a simple text file as database (no MySQL is required) while it sends a JavaScript string to display the counter.
First you have to upload a copy of the PHP file to your webspace in a folder of your choice, depending if you prefer to display a common counter for several pages of your site or only one counter for one page. In the first case, you can put the PHP file in a dedicated folder, for example, and any page that requires such a global counter, links this same PHP file. In second case you can put a copy of such a PHP file in the same folder than the involved page, for example, so that it can link its own PHP file. You will notice that a small text file will be created (going with the PHP file) after the first use of your counter, don't erase this file, it contains the datas of your counter (otherwise the count will restart from zero).
Then you insert the one line JavaScript code in the HTML script of your page, rewriting the associated value of the attribut "src" accordingly with the folder where you have put the target PHP file.
About this website | Contact me | Post a comment |
TTU © 2009 | ||