You need to split the hit counter into array with each value containing single digit, and then use for loop to append images. <?php $array = str_split($your_hit_variable_from_mysql); if(!empty($array)){ foreach($array as $single){ echo '<img src="'.$single.'.jpg"'>; } }else{ echo '<img src="0.jpg"'>; } ?> Ensure you are storing number in integer format ,...
php,mysqli,analytics,hitcounter
First, create your database table VISITOR_COUNT. You will need at least two columns - SHOW_ID and COUNT. The code in show.php could look something like this: If you want to count unique (or sort of unique - you can never be completely sure) visitors, check if a specific cookie for...
This is a pretty poor way to maintain a counter, but your problem is probably that when you fire multiple requests at the site, one of the calls to file_exists() is getting a false because one of the other processes is removing and recreating the file. If you want this...
Here's what worked for me. You can modify it as per required. What needed to be done was to pass an additional GET parameter for the related "id" in the URL, then pass that variable for it in the WHERE clause. A header was also added in order to automatically...