Web Hosting with HUGE Features and 30Day Free Trial!

Javascript Counter
Counts how many time someone has been to your page.
By: David Hyman
Browser Requirements: JS |
Run Script

<SCRIPT language=JAVASCRIPT type=TEXT/JAVASCRIPT>

<!-- By David Hyman -->
<!-- Hide script from older browsers

expireDate = new Date

expireDate.setMonth(expireDate.getMonth()+6)

hitCt = eval(cookieVal("pageHit"))

hitCt++

document.cookie = "pageHit="+hitCt+";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

}

// End hiding script -->

 

Palce this segment in html where you want the counter to be:

<SCRIPT language=JAVASCRIPT type=TEXT/JAVASCRIPT>

<!-- Hide script from older browsers

document.write("You have visited this page " + hitCt + " times.")

// End hiding script -->

</SCRIPT>