You will often see a number of websites that have a count of "You are the guest of the word", and here we will add this statistic to the bottom of the Destoon and show you how many visitors you are. Counter here and the site traffic statistics are different, the record is the number of refreshes, is not a real record of visitors to the IP, the need for real statistics friends can further improve the code to meet their own needs.
for a specific implementation:
&NBSP
Opens the file at the bottom footer.htm and finds the <a href= "{$MODULE [1][linkurl]}" rel= " External nofollow "> Back to Home </a> , add this code later:
<script language= "JavaScript" > <!--var caution = False function Setcookie (name, value, expires, path, domain, s Ecure) {var Curcookie = name + "=" + Escape (value) + ((expires)? "; Expires= "+ expires.togmtstring ():" ") + ((path)?"; Path= "+ Path:" "+ (domain)?"; domain= "+ domain:" ") + ((secure)?"; Secure ":" ") if (!caution | | (name + "=" + Escape (value)). Length <= 4000) Document.cookie = Curcookie else if (Confirm ("Cookie E
Xceeds 4KB and would be cut! ")) Document.cookie = Curcookie} function GetCookie (name) {var prefix = name + "=" var Cookiestartindex = document.c Ookie.indexof (prefix) if (Cookiestartindex = = 1) return null var Cookieendindex = document.cookie.indexOf
(";", Cookiestartindex + prefix.length) if (Cookieendindex = = 1) Cookieendindex = Document.cookie.length Return (document.cookie.substring (Cookiestartindex + prefix.length, cookie)Endindex)} function Deletecookie (name, path, domain) {if (GetCookie (name)) {Document.cookie = name + "=" + ((path)? "; Path= "+ Path:" "+ (domain)?"; domain= "+ domain:" "+"; Expires=thu, 01-jan-70 00:00:01 GMT "}} function Fixdate (date) {var base = new Date (0) var skew = Base.getti Me () if (Skew > 0) date.settime (date.gettime ()-skew)} var now = new Date () Fixdate (now) Now.settime (now). GetTime () + 365 * * * 1000) var visits = GetCookie ("Counter") if (!visits) visits = 1 else visits = par Seint (visits) + 1 Setcookie ("Counter", visits, now) document.write ("You are the first" + Visits + "A visitor to this site")//--> </script>