<!-- PAGE VISIT COUNTER --> <!-- This goes in the HEAD of the html file --> <script language="JavaScript" type="text/javascript"> <!-- Cookie script - Scott Andrew --> <!-- Counter modification - Copyright 2005, Sandeep Gangadharan --> <!-- var exp = 30; // the number at the left reflects the number of days for the cookie to last // modify it according to your needs function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameSG = name + "="; var ca = document.cookie.split(';'); for(var i=0; i<ca.length; i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameSG) == 0) return c.substring(nameSG.length,c.length); } return null; } function counter() { num = readCookie('sancookie3'); if (num < 1) { createCookie('sancookie3','2',exp); return 1; } else { newone = Math.round(num) + 1; createCookie('sancookie3',newone,exp); return num; } } alert("You have visited this page " + counter() + " times"); //--> </script>