Advertisement
EmilyTozerr

You've been here ___ times

Jun 9th, 2012
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. <div class="heart"> You have been here
  2. <SCRIPT language=JavaScript>
  3. function getCookieSlsv (offset) {
  4. var endstr = document.cookie.indexOf (";", offset);
  5. if (endstr == -1)
  6. endstr = document.cookie.length;
  7. return unescape(document.cookie.substring(offset, endstr));
  8. }
  9. function GetCookie (name) {
  10. var arg = name + "=";
  11. var alen = arg.length;
  12. var clen = document.cookie.length;
  13. var i = 0;
  14. while (i < clen) {
  15. var j = i + alen;
  16. if (document.cookie.substring(i, j) == arg)
  17. return getCookieSlsv (j);
  18. i = document.cookie.indexOf(" ", i) + 1;
  19. if (i == 0)
  20. break;
  21. }
  22. return null;
  23. }
  24. function SetCookie (name, value) {
  25. var argv = SetCookie.arguments;
  26. var argc = SetCookie.arguments.length;
  27. var expires = (argc > 2) ? argv[2] : null;
  28. var path = (argc > 3) ? argv[3] : null;
  29. var domain = (argc > 4) ? argv[4] : null;
  30. var secure = (argc > 5) ? argv[5] : false;
  31. document.cookie = name + "=" + escape (value) +
  32. ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
  33. ((path == null) ? "" : ("; path=" + path)) +
  34. ((domain == null) ? "" : ("; domain=" + domain)) +
  35. ((secure == true) ? "; secure" : "");
  36. }
  37. function DeleteCookie(name) {
  38. var exp = new Date();
  39. FixCookieDate (exp); // Correct for Mac bug
  40. exp.setTime (exp.getTime() - 1); // This cookie is history
  41. var cval = GetCookie (name);
  42. if (cval != null)
  43. document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
  44. }
  45. var expdate = new Date();
  46. var num_visits;
  47. expdate.setTime(expdate.getTime() + (365*24*60*60*1000));
  48. if (!(num_visits = GetCookie("num_visits")))
  49. num_visits = 0;
  50. num_visits++;
  51. SetCookie("num_visits",num_visits,expdate);
  52. document.writeln("<font face=verdana color=FFFFFF><B>"+num_visits+"</B></font>");
  53.  
  54. </SCRIPT> times </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement