Here's a very simple webpage counter which can be used in any html page:
First open your notepad. Copy and paste this piece of code inside:
Go to Edit then "save as". Before saving, make sure the format drop down tab is set for any file and not just txt files. Ok, now save it as "count.php".
Open notepad again. Create a file with the number "0" in it and save it as "counter.txt" which would be txt file format (not php this time), so you don't have to worry about the drop down tab change here.
Upload both files (in ASCII mode) to the root of your website. Normally this would be in your public_html or httdocs directory. It must be in your root directory to be called from your index page.
Add this piece of code into your website where you'd like the counter to show:
First open your notepad. Copy and paste this piece of code inside:
Code:
<?php
$myfile = fopen("counter.txt","r");
$count = fgets($myfile,10);
fclose($myfile);
$count+=1;
$myfile = fopen("counter.txt","w");
fwrite($myfile, $count);
echo "document.write('You are visitor number $count')";
fclose($myfile);
?>
Open notepad again. Create a file with the number "0" in it and save it as "counter.txt" which would be txt file format (not php this time), so you don't have to worry about the drop down tab change here.
Upload both files (in ASCII mode) to the root of your website. Normally this would be in your public_html or httdocs directory. It must be in your root directory to be called from your index page.
Add this piece of code into your website where you'd like the counter to show:
Code:
<HTML><BODY>
blah bla<BR /><BR />
<SCRIPT LANGUAGE="JavaScript" src="count.php"></SCRIPT>
</BODY></HTML>



.com .info
We're the affordable, reliable place to host your site. And unlike the competition, there's no set up fee and no annual commitment.
Our highly trained, courteous support staff is waiting to help. We'll resolve any issue to your complete satisfaction.