Simple and free PHP image counter script without database

Simple and free PHP image counter script without database

Simple and free PHP image counter script which works without database support, creates gif and png format graphical counter

PHP image counter
Image counters script are a craze in the coding world. Everybody wants to have a system in place which will detect the amount of hits a page or all pages of a given web site / mobile site gets. Even while this piece of coding is very simple and easy to write as well as set up on a PHP coding language supporting website, it is still not available for the general public for general usage.

About PHP
PHP is a widely used general purpose scripting language that is specially suited for Web development, online application deployment and much more. It can be embedded into HTML very easily. Many a times server hosts push for or endorse PHP driven scripting as its easy to write, lesser on resources and has a huge set of functions. As an icing on cake, if GD library is installed on the server then the usability of PHP increases ten folds. All the graphic functions come into play and creation of graphical banners becoming a reality (for the graphical usability of this script, installation or pre-installation of GD Library on host is necessary. GD is a free open source code library for the dynamic creation of images, it is either pre-installed on the server or a free installation can be requested from the host)

Coding Script
Graphic counter works on the two simple functions of image create (using GD library) and read write data to and from a 777 chmod txt file. The code for simple and free PHP image counter script without database is in the following linked txt file.

PHP Image Counter.txt

Easy steps for installing this script are as follows.

1) Copy the contents of txt file in a blank document file, name and save it as counter.php.

2) Create a txt file called count.txt save it in the same folder where the php file is saved.

3) Chmod the count.txt file with the permission 777 i.e the server can read as well as write on the file.

4) Use the html img src tag and link counter.php as the source image.

5)Your image counter, graphical counter or counter graphics whatever you may call it - is ready and live

Free Script
This script has no author copyrights, you may use it anywhere and anyhow you like as all it does is that it either creates a counter in gif image format or either in png image format. Its absolutely free. Images can be generated in gif as well as png format. If one wishes to generate PNG counter image instead of a GIF counter then one should change the following exact code in the code file.

Replace
Content-Type: image/GIF and ImageGIF ($im);
with
Content-Type: image/PNG and ImagePNG ($im);

Since both the graphic formats are universal and supported by almost all browsers, the format rarely matters. This script can be used on mobile websites / wapsites too. The counter data storage is done by the flat file count.txt and hence there is no necessity to import or export data to and from any database system like mysql or ms sql. Database support however can be used if the script is to be made more complex.

This script being one of the very firsts in the free script series is one of the most simple kind and should not be difficult to understand.

Tweet Me
DarkWAP.mobi > Free Scripts > Simple and free PHP image counter script without database
Page Comments | Submit View
Simple and free PHP image counter script which works without database support

No Contributions Yet

DarkWAP.mobi > Free Scripts > Simple and free PHP image counter script without database