Jump to content
WnSoft Forums

Web Site Visitor Count


Ronniebootwest

Recommended Posts

In the index page, you can also create your counter with a script; one example:

http://javascriptkit.com/script/script2/counter.shtml

This script with options (colors...):

Step 1: copy in your HTML beetween <head> and </head>

<!--Counter-->

<style>
.counter{
background-color:black;
color:yellow;
font-weight:bold;
}
</style>
<script>

//Personal Counter- by Jaafar Bin Yusof, Singapore (jaafar66@yahoo.com)
//Modified by JavaScript Kit (http://javascriptkit.com)
//Visit [URL=http://javascriptkit.com]http://javascriptkit.com[/URL] for this script

expireDate = new Date
expireDate.setMonth(expireDate.getMonth()+6)
jcount = eval(cookieVal("jaafarCounter"))
jcount++
document.cookie = "jaafarCounter="+jcount+";expires=" + expireDate.toGMTString()

function cookieVal(cookieName) {
thisCookie = document.cookie.split("; ")
for (i=0; i<thisCookie.length; i++){
if (cookieName == thisCookie[i].split("=")[0]){
 return thisCookie[i].split("=")[1]
}
}
return 0
}

function page_counter(){
for (i=0;i<(7-jcount.toString().length);i++)
document.write('<span class="counter">0</span>')
for (y=0;y<(jcount.toString().length);y++)
document.write('<span class="counter">'+jcount.toString().charAt(y)+'</span>')
}

</script><!--End of Counter-->

Step 2: copy in your HTML beetween <body> and </body> where you want

<!--Counter-->
This website was visited
<script>
page_counter(jcount);
</SCRIPT>
times.<!--End of Counter-->

PS:

- it's just to see how it works...you can modify the text, the color...edit also the part 2

- the counter you can find on the web are sometimes with publicity

- try...we learn so ;) !

- you can find also other counters html on the web, but I prefer in PHP

Link to comment
Share on other sites

Now that I have a working Web Site, I would like to be able to determine the number of visits made to the site. How can I add a 'counter' to the site that will update each time someone calls?

Ron

I use this site, Moostik, wich gives you a code to incorporate to your html page.

You have the possibility to add invisible counters for your visitors to whatever page you want.

Very very easy to use and customize... and it is free ;)

I use i t since a few years. :D

Link to comment
Share on other sites

Michel,

Yes I have noticed that the counter goes up whenever I go from page to page. This is not very good is it. I would like the counter to increas just when someone log on to the Web Site - do you have some code (html) that would achieve this?

Not sure what you mean by 'cookies is best' please explain.

d67,

Thanks for the link, I will have a look at that this afternoon - will it meet my requirements though, i.e. just ipdate when someone logs on the the site?

Ron

Link to comment
Share on other sites

d67,

Thanks for the link, I will have a look at that this afternoon - will it meet my requirements though, i.e. just ipdate when someone logs on the the site?

Ron

The best is to try it.

It's free,very easy to customize, invisible and easy to inplement in your html code !

For a first approach it's a very interesting tool.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...