ok, you have your site up and running. now how can you tell hove many visitors you are getting. Or whats more important you want to know how many page views or hits are you getting?

Than answer is simple, create a simple webpage counter.

What you need? You will need PHP, we recommend our friends at www.webune.com when it comes to php web hosting. they have excellent service. another thing you will need is a text editor to create your scripts. if you are using windows, you can use notepad.

so to have this counter working on your website, you will need two files and some code to put on your php website. so follow these steps:

1. Copy and Paste this code into notepad and save it as: counter.php
CODE:
<?php
############################################################
##############  http://www.wallpaperama.com   ##############
#############   Please Don't Remove This      ##############
############################################################

# THIS FILES EDITS THE log.txt FILE TO UPDATE THE NUMBER PER HITS
// this will open the log.txt and writes to it
$visit = fopen("log.txt","r");

$counter = fgets($visit,1000);
fclose($visit);

$counter=$counter + 1 ;
echo "$counter" ;

// thies will update the log.txt file with the latest visit
$visit = fopen("log.txt","w");

fwrite($visit, $counter);

fclose($visit);
?>

2. Open a blank notepad and type a 1 (one) on the first line and save it as: log.txt

3. Put this code at the bottom of your website:
CODE:
<? include ("counter.php"); ?>

You should have two files, counter.php & log.txt

IMPORTANT: If your website is being hosted in a Linux Server, its important to make your log.txt file writeable. Change the permissions to 777 because if you don't you will never see the counter change.

That's it, if you want to see it in action, our friends at www.webune.com have provided us with php web hosting to show you how this works:

hope this helps. IF this has helped you a little bit, we would appreciate if you could put our wallpaperama.com link on your website? Why? We ask this because by you putting our link in your website more people will be able to get to this tutorials and learn just like you just did now. If you are at this page, you probably found it on a search engine, we want others to benefit from everyone's knowledge so we can all learn together.

Thanks

If you have any comments or questions you can reply.