Know your visitors

Call your visitors by the name and sau them how much visits they have done.

The script
copy and paste in the [edit html] page

<script language="JavaScript"><br> <!-- Hide from older browers<br><br><br> var pham = document.cookie;<br><br> function getCookie(name) {<br> name += "="; // append '=' to name string<br> var i = 0; // index of first name=value pair<br> while (i < pham.length) {<br> var offset = i + name.length; // end of section to compare with name string<br> if (pham.substring(i, offset) == name) { // if string matches<br> var endstr = pham.indexOf(";", offset); // locate end of name=value pair<br> if (endstr == -1) endstr = pham.length;<br> return unescape(pham.substring(offset, endstr)); // return cookie value section<br> }<br> i = pham.indexOf(" ", i) + 1; // move i to next name=value pair<br> if (i == 0) break; // no more values in cookie string<br> }<br> return null; // cookie not found<br> }<br><br> var today = new Date();<br> var expiry = new Date(today.getTime() + 28 * 24 * 60 * 60 * 1000);<br><br> var headCount = getCookie("headCount") || 1;<br> var userName = getCookie("userName") || prompt("Please Enter Your Name:", "Anonymous");<br> if (userName == null || userName == "")<br> userName = "Anonymous";<br><br> if (headCount == 1) alert("Welcome, " + userName + ", this is your first visit to our site!!"); //change greeting as required<br> else if (headCount == 2) alert("Hi, " + userName + ", this is your second visit");<br> else alert("Welcome back " + userName + "\r\nYou have been here " + headCount + " times.");<br><br> document.cookie = "headCount=" + (++headCount) + "; expires=" + expiry.toGMTString();<br> document.cookie = "userName=" + escape(userName) + "; expires=" + expiry.toGMTString();<br><br> // Stop hiding --><br> </script> <br></p>

stars:
*****