PHP中字符串等同字符数组
2007/11/17 16:13 ArthurXF
这个发现是由一个问题引发出来的。如何根据字符串的位置,把字符串该位置的字符取出来?一般就是用substr函数取该位置长度为1的字符出来就实现了,可是我们还有更加简便的办法,请看下面:
这样上面的问题就太容易解决了,把位置减1,再带入数组即可。哈哈,方便啊!
引用
$str = "abc";
echo $str[1];
结果会是 b。
这样其实在php里字符串$str,本身就是数组$str。
$str = "abc";
等同于
$str[0] = "a";
$str[1] = "b";
$str[2] = "c";
echo $str[1];
结果会是 b。
这样其实在php里字符串$str,本身就是数组$str。
$str = "abc";
等同于
$str[0] = "a";
$str[1] = "b";
$str[2] = "c";
这样上面的问题就太容易解决了,把位置减1,再带入数组即可。哈哈,方便啊!
Google Analytics Urchin Module 源码
2007/11/17 15:40 ArthurXF
学习一下urchin.js的源代码:
=8))>0)>0)>>>>=-1)>=-1)>2)+(t>"0">
引用
//-- Google Analytics Urchin Module
//-- Copyright 2005 Google, All Rights Reserved.
//-- Urchin On Demand Settings ONLY
var _uacct=""; // set up the Urchin Account
var _userv=1; // service mode (0=local,1=remote,2=both)
//-- UTM User Settings
var _ufsc=1; // set client info flag (1=on|0=off)
var _udn="auto"; // (auto|none|domain) set the domain name for cookies
var _uhash="on"; // (on|off) unique domain hash for cookies
var _utimeout="1800"; // set the inactive session timeout in seconds
var _ugifpath="/__utm.gif"; // set the web path to the __utm.gif file
var _utsp="|"; // transaction field separator
var _uflash=1; // set flash version detect option (1=on|0=off)
var _utitle=1; // set the document title detect option (1=on|0=off)
var _ulink=0; // enable linker functionality (1=on|0=off)
//-- UTM Campaign Tracking Settings
var _uctm=1; // set campaign tracking module (1=on|0=off)
var _ucto="15768000"; // set timeout in seconds (6 month default)
var _uccn="utm_campaign"; // name
var _ucmd="utm_medium"; // medium (cpc|cpm|link|email|organic)
var _ucsr="utm_source"; // source
var _uctr="utm_term"; // term/keyword
var _ucct="utm_content"; // content
var _ucid="utm_id"; // id number
var _ucno="utm_nooverride"; // don't override
//-- Auto/Organic Sources and Keywords
var _uOsr=new Array();
var _uOkw=new Array();
_uOsr[0]="google"; _uOkw[0]="q";
_uOsr[1]="yahoo"; _uOkw[1]="p";
_uOsr[2]="msn"; _uOkw[2]="q";
_uOsr[3]="aol"; _uOkw[3]="query";
_uOsr[4]="lycos"; _uOkw[4]="query";
_uOsr[5]="ask"; _uOkw[5]="q";
_uOsr[6]="altavista"; _uOkw[6]="q";
_uOsr[7]="search"; _uOkw[7]="q";
_uOsr[8]="netscape"; _uOkw[8]="query";
_uOsr[9]="earthlink"; _uOkw[9]="q";
_uOsr[10]="cnn"; _uOkw[10]="query";
_uOsr[11]="looksmart"; _uOkw[11]="key";
_uOsr[12]="about"; _uOkw[12]="terms";
_uOsr[13]="excite"; _uOkw[13]="qkw";
_uOsr[14]="mamma"; _uOkw[14]="query";
_uOsr[15]="alltheweb"; _uOkw[15]="q";
_uOsr[16]="gigablast"; _uOkw[16]="q";
_uOsr[17]="voila"; _uOkw[17]="kw";
_uOsr[18]="virgilio"; _uOkw[18]="qs";
_uOsr[19]="teoma"; _uOkw[19]="q";
//-- Auto/Organic Keywords to Ignore
var _uOno=new Array();
//_uOno[0]="urchin";
//_uOno[1]="urchin.com";
//_uOno[2]="www.urchin.com";
//-- Auto/Organic Keywords to Ignore
var _uOno=new Array();
//_uOno[0]="urchin";
//_uOno[1]="urchin.com";
//_uOno[2]="www.urchin.com";
//-- Auto/Organic Keywords to Ignore
var _uOno=new Array();
//_uOno[0]="urchin";
//_uOno[1]="urchin.com";
//_uOno[2]="www.urchin.com";
//-- Auto/Organic Keywords to Ignore
var _uOno=new Array();
//_uOno[0]="urchin";
//_uOno[1]="urchin.com";
//_uOno[2]="www.urchin.com";
//-- Referral domains to Ignore
var _uRno=new Array();
//_uRno[0]=".urchin.com";
//-- **** Don't modify below this point ***
var _uff,_udh,_udt,_ubl=0,_udo="",_uu,_ufns=0,_uns=0,_ur="-",_ufno=0,_ust=0,_ubd=document,_udl=_ubd.location,_u
tcp="/",_uwv="1";
var _ugifpath2="http://www.google-analytics.com/__utm.gif";
if (_udl.protocol=="https:") _ugifpath2="https://ssl.google-analytics.com/__utm.gif";
if (!_utcp || _utcp=="") _utcp="/";
function urchinTracker(page) {
if (_udl.protocol=="file:") return;
if (_uff && (!page || page=="")) return;
var a,b,c,v,z,k,x="",s="",f=0;
var nx=" expires=Sun, 18 Jan 2038 00:00:00 GMT;";
var dc=_ubd.cookie;
_udh=_uDomain();
_uu=Math.round(Math.random()*2147483647);
_udt=new Date();
_ust=Math.round(_udt.getTime()/1000);
a=dc.indexOf("__utma="+_udh);
b=dc.indexOf("__utmb="+_udh);
c=dc.indexOf("__utmc="+_udh);
if (_udn && _udn!="") { _udo=" domain="+_udn+";"; }
if (_utimeout && _utimeout!="") {
x=new Date(_udt.getTime()+(_utimeout*1000));
x=" expires="+x.toGMTString()+";";
}
if (_ulink) {
s=_udl.search;
if(s && s!="" && s.indexOf("__utma=")>=0) {
if (!(_uIN(a=_uGC(s,"__utma=","&")))) a="-";
if (!(_uIN(b=_uGC(s,"__utmb=","&")))) b="-";
if (!(_uIN(c=_uGC(s,"__utmc=","&")))) c="-";
v=_uGC(s,"__utmv=","&");
z=_uGC(s,"__utmz=","&");
k=_uGC(s,"__utmk=","&");
if ((k*1) != ((_uHash(a+b+c+z+v)*1)+(_udh*1))) {_ubl=1;a="-";b="-";c="-";z="-";v="-";}
if (a!="-" && b!="-" && c!="-") f=1;
else if(a!="-") f=2;
}
}
if(f==1) {
_ubd.cookie="__utma="+a+"; path="+_utcp+";"+nx+_udo;
_ubd.cookie="__utmb="+b+"; path="+_utcp+";"+x+_udo;
_ubd.cookie="__utmc="+c+"; path="+_utcp+";"+_udo;
} else if (f==2) {
a=_uFixA(s,"&",_ust);
_ubd.cookie="__utma="+a+"; path="+_utcp+";"+nx+_udo;
_ubd.cookie="__utmb="+_udh+"; path="+_utcp+";"+x+_udo;
_ubd.cookie="__utmc="+_udh+"; path="+_utcp+";"+_udo;
_ufns=1;
} else if (a>=0 && b>=0 && c>=0) {
_ubd.cookie="__utmb="+_udh+"; path="+_utcp+";"+x+_udo;
} else {
if (a>=0) a=_uFixA(_ubd.cookie,";",_ust);
else a=_udh+"."+_uu+"."+_ust+"."+_ust+"."+_ust+".1";
_ubd.cookie="__utma="+a+"; path="+_utcp+";"+nx+_udo;
_ubd.cookie="__utmb="+_udh+"; path="+_utcp+";"+x+_udo;
_ubd.cookie="__utmc="+_udh+"; path="+_utcp+";"+_udo;
_ufns=1;
}
if (_ulink && v && v!="" && v!="-") {
v=unescape(v);
if (v.indexOf(";")==-1) _ubd.cookie="__utmv="+v+"; path="+_utcp+";"+nx+_udo;
}
_uInfo(page);
_ufns=0;
_ufno=0;
_uff=1;
}
function _uInfo(page) {
var p,s="",pg=_udl.pathname+_udl.search;
if (page && page!="") pg=escape(page);
_ur=_ubd.referrer;
if (!_ur || _ur=="") { _ur="-"; }
else {
p=_ur.indexOf(_ubd.domain);
if ((p>=0) && (p<=8)) { _ur="0"; }
if (_ur.indexOf("[")==0 && _ur.lastIndexOf("]")==(_ur.length-1)) { _ur="-"; }
}
s+="&utmn="+_uu;
if (_ufsc) s+=_uBInfo(page);
if (_uctm && (!page || page=="")) s+=_uCInfo();
if (_utitle && _ubd.title && _ubd.title!="") s+="&utmdt="+escape(_ubd.title);
if (_udl.hostname && _udl.hostname!="") s+="&utmhn="+escape(_udl.hostname);
if (!page || page=="") s+="&utmr="+_ur;
s+="&utmp="+pg;
if (_userv==0 || _userv==2) {
var i=new Image(1,1);
i.src=_ugifpath+"?"+"utmwv="+_uwv+s;
i.onload=function() {_uVoid();}
}
if (_userv==1 || _userv==2) {
var i2=new Image(1,1);
i2.src=_ugifpath2+"?"+"utmwv="+_uwv+s+"&utmac="+_uacct+"&utmcc="+_uGCS();
i2.onload=function() { _uVoid(); }
}
return;
}
function _uVoid() { return; }
function _uCInfo() {
if (!_ucto || _ucto=="") { _ucto="15768000"; }
var c="",t="-",t2="-",t3="-",o=0,cs=0,cn=0;i=0;z="-";
var s=_udl.search;
var x=new Date(_udt.getTime()+(_ucto*1000));
var dc=_ubd.cookie;
x=" expires="+x.toGMTString()+";";
if (_ulink && !_ubl) {
z=unescape(_uGC(s,"__utmz=","&"));
if (z!="-" && z.indexOf(";")==-1) { _ubd.cookie="__utmz="+z+"; path="+_utcp+";"+x+_udo; return ""; }
}
z=dc.indexOf("__utmz="+_udh);
if (z>-1) { z=_uGC(dc,"__utmz="+_udh,";"); }
else { z="-"; }
t=_uGC(s,_ucid+"=","&");
t2=_uGC(s,_ucsr+"=","&");
t3=_uGC(s,"gclid=","&");
if ((t!="-" && t!="") || (t2!="-" && t2!="") || (t3!="-" && t3!="")) {
if (t!="-" && t!="") c+="utmcid="+_uEC(t);
if (t2!="-" && t2!="") { if (c != "") c+="|"; c+="utmcsr="+_uEC(t2); }
if (t3!="-" && t3!="") { if (c != "") c+="|"; c+="utmgclid="+_uEC(t3); }
t=_uGC(s,_uccn+"=","&");
if (t!="-" && t!="") c+="|utmccn="+_uEC(t);
else c+="|utmccn=(not+set)";
t=_uGC(s,_ucmd+"=","&");
if (t!="-" && t!="") c+="|utmcmd="+_uEC(t);
else c+="|utmcmd=(not+set)";
t=_uGC(s,_uctr+"=","&");
if (t!="-" && t!="") c+="|utmctr="+_uEC(t);
else { t=_uOrg(1); if (t!="-" && t!="") c+="|utmctr="+_uEC(t); }
t=_uGC(s,_ucct+"=","&");
if (t!="-" && t!="") c+="|utmcct="+_uEC(t);
t=_uGC(s,_ucno+"=","&");
if (t=="1") o=1;
if (z!="-" && o==1) return "";
}
if (c=="-" || c=="") { c=_uOrg(); if (z!="-" && _ufno==1) return ""; }
if (c=="-" || c=="") { if (_ufns==1) c=_uRef(); if (z!="-" && _ufno==1) return ""; }
if (c=="-" || c=="") {
if (z=="-" && _ufns==1) { c="utmccn=(direct)|utmcsr=(direct)|utmcmd=(none)"; }
if (c=="-" || c=="") return "";
}
if (z!="-") {
i=z.indexOf(".");
if (i>-1) i=z.indexOf(".",i+1);
if (i>-1) i=z.indexOf(".",i+1);
if (i>-1) i=z.indexOf(".",i+1);
t=z.substring(i+1,z.length);
if (t.toLowerCase()==c.toLowerCase()) cs=1;
t=z.substring(0,i);
if ((i=t.lastIndexOf(".")) > -1) {
t=t.substring(i+1,t.length);
cn=(t*1);
}
}
if (cs==0 || _ufns==1) {
t=_uGC(dc,"__utma="+_udh,";");
if ((i=t.lastIndexOf(".")) > 9) {
_uns=t.substring(i+1,t.length);
_uns=(_uns*1);
}
cn++;
if (_uns==0) _uns=1;
_ubd.cookie="__utmz="+_udh+"."+_ust+"."+_uns+"."+cn+"."+c+"; path="+_utcp+"; "+x+_udo;
}
if (cs==0 || _ufns==1) return "&utmcn=1";
else return "&utmcr=1";
}
function _uRef() {
if (_ur=="0" || _ur=="" || _ur=="-") return "";
var i=0,h,k,n;
if ((i=_ur.indexOf("://"))<0) return "";
h=_ur.substring(i+3,_ur.length);
if (h.indexOf("/") > -1) {
k=h.substring(h.indexOf("/"),h.length);
if (k.indexOf("?") > -1) k=k.substring(0,k.indexOf("?"));
h=h.substring(0,h.indexOf("/"));
}
h=h.toLowerCase();
n=h;
if ((i=n.indexOf(":")) > -1) n=n.substring(0,i);
for (var ii=0;ii<_uRno.length;ii++) {
if ((i=n.indexOf(_uRno[ii].toLowerCase())) > -1 && n.length==(i+_uRno[ii].length)) { _ufno=1; break; }
}
if (h.indexOf("www.")==0) h=h.substring(4,h.length);
return "utmccn=(referral)|utmcsr="+_uEC(h)+"|"+"utmcct="+_uEC(k)+"|utmcmd=referral";
}
function _uOrg(t) {
if (_ur=="0" || _ur=="" || _ur=="-") return "";
var i=0,h,k;
if ((i=_ur.indexOf("://")) < 0) return "";
h=_ur.substring(i+3,_ur.length);
if (h.indexOf("/") > -1) {
h=h.substring(0,h.indexOf("/"));
}
for (var ii=0;ii<_uOsr.length;ii++) {
if (h.indexOf(_uOsr[ii]) > -1) {
if ((i=_ur.indexOf("?"+_uOkw[ii]+"=")) > -1 || (i=_ur.indexOf("&"+_uOkw[ii]+"=")) > -1) {
k=_ur.substring(i+_uOkw[ii].length+2,_ur.length);
if ((i=k.indexOf("&")) > -1) k=k.substring(0,i);
for (var yy=0;yy<_uOno.length;yy++) {
if (_uOno[yy].toLowerCase()==k.toLowerCase()) { _ufno=1; break; }
}
if (t) return _uEC(k);
else return "utmccn=(organic)|utmcsr="+_uEC(_uOsr[ii])+"|"+"utmctr="+_uEC(k)+"|utmcmd=organic";
}
}
}
return "";
}
function _uBInfo(page) {
var sr="-",sc="-",ul="-",fl="-",je=1;
var n=navigator;
if (self.screen) {
sr=screen.width+"x"+screen.height;
sc=screen.colorDepth+"-bit";
} else if (self.java) {
var j=java.awt.Toolkit.getDefaultToolkit();
var s=j.getScreenSize();
sr=s.width+"x"+s.height;
}
if (n.language) { ul=n.language.toLowerCase(); }
else if (n.browserLanguage) { ul=n.browserLanguage.toLowerCase(); }
je=n.javaEnabled()?1:0;
if (_uflash) fl=_uFlash();
return "&utmsr="+sr+"&utmsc="+sc+"&utmul="+ul+"&utmje="+je+"&utmfl="+fl;
}
function __utmSetTrans() {
var e;
if (_ubd.getElementById) e=_ubd.getElementById("utmtrans");
else if (_ubd.utmform && _ubd.utmform.utmtrans) e=_ubd.utmform.utmtrans;
if (!e) return;
var l=e.value.split("UTM:");
var i,i2,c;
if (_userv==0 || _userv==2) i=new Array();
if (_userv==1 || _userv==2) { i2=new Array(); c=_uGCS(); }
for (var ii=0;ii l[ii]=_uTrim(l[ii]);
if (l[ii].charAt(0)!='T' && l[ii].charAt(0)!='I') continue;
var r=Math.round(Math.random()*2147483647);
if (!_utsp || _utsp=="") _utsp="|";
var f=l[ii].split(_utsp),s="";
if (f[0].charAt(0)=='T') {
s="&utmt=tran"+"&utmn="+r;
f[1]=_uTrim(f[1]); if(f[1]&&f[1]!="") s+="&utmtid="+escape(f[1]);
f[2]=_uTrim(f[2]); if(f[2]&&f[2]!="") s+="&utmtst="+escape(f[2]);
f[3]=_uTrim(f[3]); if(f[3]&&f[3]!="") s+="&utmtto="+escape(f[3]);
f[4]=_uTrim(f[4]); if(f[4]&&f[4]!="") s+="&utmttx="+escape(f[4]);
f[5]=_uTrim(f[5]); if(f[5]&&f[5]!="") s+="&utmtsp="+escape(f[5]);
f[6]=_uTrim(f[6]); if(f[6]&&f[6]!="") s+="&utmtci="+escape(f[6]);
f[7]=_uTrim(f[7]); if(f[7]&&f[7]!="") s+="&utmtrg="+escape(f[7]);
f[8]=_uTrim(f[8]); if(f[8]&&f[8]!="") s+="&utmtco="+escape(f[8]);
} else {
s="&utmt=item"+"&utmn="+r;
f[1]=_uTrim(f[1]); if(f[1]&&f[1]!="") s+="&utmtid="+escape(f[1]);
f[2]=_uTrim(f[2]); if(f[2]&&f[2]!="") s+="&utmipc="+escape(f[2]);
f[3]=_uTrim(f[3]); if(f[3]&&f[3]!="") s+="&utmipn="+escape(f[3]);
f[4]=_uTrim(f[4]); if(f[4]&&f[4]!="") s+="&utmiva="+escape(f[4]);
f[5]=_uTrim(f[5]); if(f[5]&&f[5]!="") s+="&utmipr="+escape(f[5]);
f[6]=_uTrim(f[6]); if(f[6]&&f[6]!="") s+="&utmiqt="+escape(f[6]);
}
if (_userv==0 || _userv==2) {
i[ii]=new Image(1,1);
i[ii].src=_ugifpath+"?"+"utmwv="+_uwv+s;
i[ii].onload=function() { _uVoid(); }
}
if (_userv==1 || _userv==2) {
i2[ii]=new Image(1,1);
i2[ii].src=_ugifpath2+"?"+"utmwv="+_uwv+s+"&utmac="+_uacct+"&utmcc="+c;
i2[ii].onload=function() { _uVoid(); }
}
}
return;
}
function _uFlash() {
var f="-",n=navigator;
if (n.plugins && n.plugins.length) {
for (var ii=0;ii if (n.plugins[ii].name.indexOf('Shockwave Flash')!=-1) {
f=n.plugins[ii].description.split('Shockwave Flash ')[1];
break;
}
}
} else if (window.ActiveXObject) {
for (var ii=10;ii>=2;ii--) {
try {
var fl=eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash."+ii+"');");
if (fl) { f=ii + '.0'; break; }
}
catch(e) {}
}
}
return f;
}
function __utmLinker(l) {
if (!_ulink) return;
var p,k,a="-",b="-",c="-",z="-",v="-";
var dc=_ubd.cookie;
if (l && l!="") {
if (dc) {
a=escape(_uGC(dc,"__utma="+_udh,";"));
b=escape(_uGC(dc,"__utmb="+_udh,";"));
c=escape(_uGC(dc,"__utmc="+_udh,";"));
z=escape(_uGC(dc,"__utmz="+_udh,";"));
v=escape(_uGC(dc,"__utmv="+_udh,";"));
k=(_uHash(a+b+c+z+v)*1)+(_udh*1);
p="__utma="+a+"&__utmb="+b+"&__utmc="+c+"&__utmz="+z+"&__utmv="+v+"&__utmk="+k;
}
if (p) {
if (l.indexOf("?")<=-1) { document.location=l+"?"+p; }
else { document.location=l+"&"+p; }
} else { document.location=l; }
}
}
function __utmLinkPost(f) {
if (!_ulink) return;
var p,k,a="-",b="-",c="-",z="-",v="-";
var dc=_ubd.cookie;
if (!f || !f.action) return;
if (dc) {
a=escape(_uGC(dc,"__utma="+_udh,";"));
b=escape(_uGC(dc,"__utmb="+_udh,";"));
c=escape(_uGC(dc,"__utmc="+_udh,";"));
z=escape(_uGC(dc,"__utmz="+_udh,";"));
v=escape(_uGC(dc,"__utmv="+_udh,";"));
k=(_uHash(a+b+c+z+v)*1)+(_udh*1);
p="__utma="+a+"&__utmb="+b+"&__utmc="+c+"&__utmz="+z+"&__utmv="+v+"&__utmk="+k;
}
if (p) {
if (f.action.indexOf("?")<=-1) f.action+="?"+p;
else f.action+="&"+p;
}
return;
}
function __utmSetVar(v) {
if (!v || v=="") return;
var r=Math.round(Math.random() * 2147483647);
_ubd.cookie="__utmv="+_udh+"."+escape(v)+"; path="+_utcp+"; expires=Sun, 18 Jan 2038 00:00:00 GMT;"+_udo;
var s="&utmt=var&utmn="+r;
if (_userv==0 || _userv==2) {
var i=new Image(1,1);
i.src=_ugifpath+"?"+"utmwv="+_uwv+s;
i.onload=function() { _uVoid(); }
}
if (_userv==1 || _userv==2) {
var i2=new Image(1,1);
i2.src=_ugifpath2+"?"+"utmwv="+_uwv+s+"&utmac="+_uacct+"&utmcc="+_uGCS();
i2.onload=function() { _uVoid(); }
}
}
function _uGCS() {
var t,c="",dc=_ubd.cookie;
if ((t=_uGC(dc,"__utma="+_udh,";"))!="-") c+=escape("__utma="+t+";+");
if ((t=_uGC(dc,"__utmb="+_udh,";"))!="-") c+=escape("__utmb="+t+";+");
if ((t=_uGC(dc,"__utmc="+_udh,";"))!="-") c+=escape("__utmc="+t+";+");
if ((t=_uGC(dc,"__utmz="+_udh,";"))!="-") c+=escape("__utmz="+t+";+");
if ((t=_uGC(dc,"__utmv="+_udh,";"))!="-") c+=escape("__utmv="+t+";");
if (c.charAt(c.length-1)=="+") c=c.substring(0,c.length-1);
return c;
}
function _uGC(l,n,s) {
if (!l || l=="" || !n || n=="" || !s || s=="") return "-";
var i,i2,i3,c="-";
i=l.indexOf(n);
i3=n.indexOf("=")+1;
if (i > -1) {
i2=l.indexOf(s,i); if (i2 < 0) { i2=l.length; }
c=l.substring((i+i3),i2);
}
return c;
}
function _uDomain() {
if (!_udn || _udn=="" || _udn=="none") { _udn=""; return 1; }
if (_udn=="auto") {
var d=_ubd.domain;
if (d.substring(0,4)=="www.") {
d=d.substring(4,d.length);
}
_udn=d;
}
if (_uhash=="off") return 1;
return _uHash(_udn);
}
function _uHash(d) {
if (!d || d=="") return 1;
var h=0,g=0;
for (var i=d.length-1;i>=0;i--) {
var c=parseInt(d.charCodeAt(i));
h=((h << 6) & 0xfffffff) + c + (c << 14);
if ((g=h & 0xfe00000)!=0) h=(h ^ (g >> 21));
}
return h;
}
function _uFixA(c,s,t) {
if (!c || c=="" || !s || s=="" || !t || t=="") return "-";
var a=_uGC(c,"__utma="+_udh,s);
var lt=0,i=0;
if ((i=a.lastIndexOf(".")) > 9) {
_uns=a.substring(i+1,a.length);
_uns=(_uns*1)+1;
a=a.substring(0,i);
if ((i=a.lastIndexOf(".")) > 7) {
lt=a.substring(i+1,a.length);
a=a.substring(0,i);
}
if ((i=a.lastIndexOf(".")) > 5) {
a=a.substring(0,i);
}
a+="."+lt+"."+t+"."+_uns;
}
return a;
}
function _uTrim(s) {
if (!s || s=="") return "";
while ((s.charAt(0)==' ') || (s.charAt(0)=='\n') || (s.charAt(0,1)=='\r')) s=s.substring(1,s.length);
while ((s.charAt(s.length-1)==' ') || (s.charAt(s.length-1)=='\n') || (s.charAt(s.length-1)=='\r')) s=s.subst
ring(0,s.length-1);
return s;
}
function _uEC(s) {
var n="";
if (!s || s=="") return "";
for (var i=0;i return n;
}
function __utmVisitorCode() {
var r=0,t=0,i=0,i2=0,m=31;
var a=_uGC(_ubd.cookie,"__utma="+_udh,";");
if ((i=a.indexOf(".",0))<0) return;
if ((i2=a.indexOf(".",i+1))>0) r=a.substring(i+1,i2); else return "";
if ((i=a.indexOf(".",i2+1))>0) t=a.substring(i2+1,i); else return "";
var c=new Array('A','B','C','D','E','F','G','H','J','K','L','M','N','P','R','S','T','U','V','W','X','Y','Z','1
','2','3','4','5','6','7','8','9');
return c[r>>28&m]+c[r>>23&m]+c[r>>18&m]+c[r>>13&m]+"-"+c[r>>8&m]+c[r>>3&m]+c[((r&7)<<2)+(t>>30&3)]+c[t>>25&m]+
c[t>>20&m]+"-"+c[t>>15&m]+c[t>>10&m]+c[t>>5&m]+c[t&m];
}
function _uIN(n) {
if (!n) return false;
for (i=0;i var c=n.charAt(i);
if ((c<"0" || c>"9") && (c!=".")) return false;
}
return true;
}
//-- Copyright 2005 Google, All Rights Reserved.
//-- Urchin On Demand Settings ONLY
var _uacct=""; // set up the Urchin Account
var _userv=1; // service mode (0=local,1=remote,2=both)
//-- UTM User Settings
var _ufsc=1; // set client info flag (1=on|0=off)
var _udn="auto"; // (auto|none|domain) set the domain name for cookies
var _uhash="on"; // (on|off) unique domain hash for cookies
var _utimeout="1800"; // set the inactive session timeout in seconds
var _ugifpath="/__utm.gif"; // set the web path to the __utm.gif file
var _utsp="|"; // transaction field separator
var _uflash=1; // set flash version detect option (1=on|0=off)
var _utitle=1; // set the document title detect option (1=on|0=off)
var _ulink=0; // enable linker functionality (1=on|0=off)
//-- UTM Campaign Tracking Settings
var _uctm=1; // set campaign tracking module (1=on|0=off)
var _ucto="15768000"; // set timeout in seconds (6 month default)
var _uccn="utm_campaign"; // name
var _ucmd="utm_medium"; // medium (cpc|cpm|link|email|organic)
var _ucsr="utm_source"; // source
var _uctr="utm_term"; // term/keyword
var _ucct="utm_content"; // content
var _ucid="utm_id"; // id number
var _ucno="utm_nooverride"; // don't override
//-- Auto/Organic Sources and Keywords
var _uOsr=new Array();
var _uOkw=new Array();
_uOsr[0]="google"; _uOkw[0]="q";
_uOsr[1]="yahoo"; _uOkw[1]="p";
_uOsr[2]="msn"; _uOkw[2]="q";
_uOsr[3]="aol"; _uOkw[3]="query";
_uOsr[4]="lycos"; _uOkw[4]="query";
_uOsr[5]="ask"; _uOkw[5]="q";
_uOsr[6]="altavista"; _uOkw[6]="q";
_uOsr[7]="search"; _uOkw[7]="q";
_uOsr[8]="netscape"; _uOkw[8]="query";
_uOsr[9]="earthlink"; _uOkw[9]="q";
_uOsr[10]="cnn"; _uOkw[10]="query";
_uOsr[11]="looksmart"; _uOkw[11]="key";
_uOsr[12]="about"; _uOkw[12]="terms";
_uOsr[13]="excite"; _uOkw[13]="qkw";
_uOsr[14]="mamma"; _uOkw[14]="query";
_uOsr[15]="alltheweb"; _uOkw[15]="q";
_uOsr[16]="gigablast"; _uOkw[16]="q";
_uOsr[17]="voila"; _uOkw[17]="kw";
_uOsr[18]="virgilio"; _uOkw[18]="qs";
_uOsr[19]="teoma"; _uOkw[19]="q";
//-- Auto/Organic Keywords to Ignore
var _uOno=new Array();
//_uOno[0]="urchin";
//_uOno[1]="urchin.com";
//_uOno[2]="www.urchin.com";
//-- Auto/Organic Keywords to Ignore
var _uOno=new Array();
//_uOno[0]="urchin";
//_uOno[1]="urchin.com";
//_uOno[2]="www.urchin.com";
//-- Auto/Organic Keywords to Ignore
var _uOno=new Array();
//_uOno[0]="urchin";
//_uOno[1]="urchin.com";
//_uOno[2]="www.urchin.com";
//-- Auto/Organic Keywords to Ignore
var _uOno=new Array();
//_uOno[0]="urchin";
//_uOno[1]="urchin.com";
//_uOno[2]="www.urchin.com";
//-- Referral domains to Ignore
var _uRno=new Array();
//_uRno[0]=".urchin.com";
//-- **** Don't modify below this point ***
var _uff,_udh,_udt,_ubl=0,_udo="",_uu,_ufns=0,_uns=0,_ur="-",_ufno=0,_ust=0,_ubd=document,_udl=_ubd.location,_u
tcp="/",_uwv="1";
var _ugifpath2="http://www.google-analytics.com/__utm.gif";
if (_udl.protocol=="https:") _ugifpath2="https://ssl.google-analytics.com/__utm.gif";
if (!_utcp || _utcp=="") _utcp="/";
function urchinTracker(page) {
if (_udl.protocol=="file:") return;
if (_uff && (!page || page=="")) return;
var a,b,c,v,z,k,x="",s="",f=0;
var nx=" expires=Sun, 18 Jan 2038 00:00:00 GMT;";
var dc=_ubd.cookie;
_udh=_uDomain();
_uu=Math.round(Math.random()*2147483647);
_udt=new Date();
_ust=Math.round(_udt.getTime()/1000);
a=dc.indexOf("__utma="+_udh);
b=dc.indexOf("__utmb="+_udh);
c=dc.indexOf("__utmc="+_udh);
if (_udn && _udn!="") { _udo=" domain="+_udn+";"; }
if (_utimeout && _utimeout!="") {
x=new Date(_udt.getTime()+(_utimeout*1000));
x=" expires="+x.toGMTString()+";";
}
if (_ulink) {
s=_udl.search;
if(s && s!="" && s.indexOf("__utma=")>=0) {
if (!(_uIN(a=_uGC(s,"__utma=","&")))) a="-";
if (!(_uIN(b=_uGC(s,"__utmb=","&")))) b="-";
if (!(_uIN(c=_uGC(s,"__utmc=","&")))) c="-";
v=_uGC(s,"__utmv=","&");
z=_uGC(s,"__utmz=","&");
k=_uGC(s,"__utmk=","&");
if ((k*1) != ((_uHash(a+b+c+z+v)*1)+(_udh*1))) {_ubl=1;a="-";b="-";c="-";z="-";v="-";}
if (a!="-" && b!="-" && c!="-") f=1;
else if(a!="-") f=2;
}
}
if(f==1) {
_ubd.cookie="__utma="+a+"; path="+_utcp+";"+nx+_udo;
_ubd.cookie="__utmb="+b+"; path="+_utcp+";"+x+_udo;
_ubd.cookie="__utmc="+c+"; path="+_utcp+";"+_udo;
} else if (f==2) {
a=_uFixA(s,"&",_ust);
_ubd.cookie="__utma="+a+"; path="+_utcp+";"+nx+_udo;
_ubd.cookie="__utmb="+_udh+"; path="+_utcp+";"+x+_udo;
_ubd.cookie="__utmc="+_udh+"; path="+_utcp+";"+_udo;
_ufns=1;
} else if (a>=0 && b>=0 && c>=0) {
_ubd.cookie="__utmb="+_udh+"; path="+_utcp+";"+x+_udo;
} else {
if (a>=0) a=_uFixA(_ubd.cookie,";",_ust);
else a=_udh+"."+_uu+"."+_ust+"."+_ust+"."+_ust+".1";
_ubd.cookie="__utma="+a+"; path="+_utcp+";"+nx+_udo;
_ubd.cookie="__utmb="+_udh+"; path="+_utcp+";"+x+_udo;
_ubd.cookie="__utmc="+_udh+"; path="+_utcp+";"+_udo;
_ufns=1;
}
if (_ulink && v && v!="" && v!="-") {
v=unescape(v);
if (v.indexOf(";")==-1) _ubd.cookie="__utmv="+v+"; path="+_utcp+";"+nx+_udo;
}
_uInfo(page);
_ufns=0;
_ufno=0;
_uff=1;
}
function _uInfo(page) {
var p,s="",pg=_udl.pathname+_udl.search;
if (page && page!="") pg=escape(page);
_ur=_ubd.referrer;
if (!_ur || _ur=="") { _ur="-"; }
else {
p=_ur.indexOf(_ubd.domain);
if ((p>=0) && (p<=8)) { _ur="0"; }
if (_ur.indexOf("[")==0 && _ur.lastIndexOf("]")==(_ur.length-1)) { _ur="-"; }
}
s+="&utmn="+_uu;
if (_ufsc) s+=_uBInfo(page);
if (_uctm && (!page || page=="")) s+=_uCInfo();
if (_utitle && _ubd.title && _ubd.title!="") s+="&utmdt="+escape(_ubd.title);
if (_udl.hostname && _udl.hostname!="") s+="&utmhn="+escape(_udl.hostname);
if (!page || page=="") s+="&utmr="+_ur;
s+="&utmp="+pg;
if (_userv==0 || _userv==2) {
var i=new Image(1,1);
i.src=_ugifpath+"?"+"utmwv="+_uwv+s;
i.onload=function() {_uVoid();}
}
if (_userv==1 || _userv==2) {
var i2=new Image(1,1);
i2.src=_ugifpath2+"?"+"utmwv="+_uwv+s+"&utmac="+_uacct+"&utmcc="+_uGCS();
i2.onload=function() { _uVoid(); }
}
return;
}
function _uVoid() { return; }
function _uCInfo() {
if (!_ucto || _ucto=="") { _ucto="15768000"; }
var c="",t="-",t2="-",t3="-",o=0,cs=0,cn=0;i=0;z="-";
var s=_udl.search;
var x=new Date(_udt.getTime()+(_ucto*1000));
var dc=_ubd.cookie;
x=" expires="+x.toGMTString()+";";
if (_ulink && !_ubl) {
z=unescape(_uGC(s,"__utmz=","&"));
if (z!="-" && z.indexOf(";")==-1) { _ubd.cookie="__utmz="+z+"; path="+_utcp+";"+x+_udo; return ""; }
}
z=dc.indexOf("__utmz="+_udh);
if (z>-1) { z=_uGC(dc,"__utmz="+_udh,";"); }
else { z="-"; }
t=_uGC(s,_ucid+"=","&");
t2=_uGC(s,_ucsr+"=","&");
t3=_uGC(s,"gclid=","&");
if ((t!="-" && t!="") || (t2!="-" && t2!="") || (t3!="-" && t3!="")) {
if (t!="-" && t!="") c+="utmcid="+_uEC(t);
if (t2!="-" && t2!="") { if (c != "") c+="|"; c+="utmcsr="+_uEC(t2); }
if (t3!="-" && t3!="") { if (c != "") c+="|"; c+="utmgclid="+_uEC(t3); }
t=_uGC(s,_uccn+"=","&");
if (t!="-" && t!="") c+="|utmccn="+_uEC(t);
else c+="|utmccn=(not+set)";
t=_uGC(s,_ucmd+"=","&");
if (t!="-" && t!="") c+="|utmcmd="+_uEC(t);
else c+="|utmcmd=(not+set)";
t=_uGC(s,_uctr+"=","&");
if (t!="-" && t!="") c+="|utmctr="+_uEC(t);
else { t=_uOrg(1); if (t!="-" && t!="") c+="|utmctr="+_uEC(t); }
t=_uGC(s,_ucct+"=","&");
if (t!="-" && t!="") c+="|utmcct="+_uEC(t);
t=_uGC(s,_ucno+"=","&");
if (t=="1") o=1;
if (z!="-" && o==1) return "";
}
if (c=="-" || c=="") { c=_uOrg(); if (z!="-" && _ufno==1) return ""; }
if (c=="-" || c=="") { if (_ufns==1) c=_uRef(); if (z!="-" && _ufno==1) return ""; }
if (c=="-" || c=="") {
if (z=="-" && _ufns==1) { c="utmccn=(direct)|utmcsr=(direct)|utmcmd=(none)"; }
if (c=="-" || c=="") return "";
}
if (z!="-") {
i=z.indexOf(".");
if (i>-1) i=z.indexOf(".",i+1);
if (i>-1) i=z.indexOf(".",i+1);
if (i>-1) i=z.indexOf(".",i+1);
t=z.substring(i+1,z.length);
if (t.toLowerCase()==c.toLowerCase()) cs=1;
t=z.substring(0,i);
if ((i=t.lastIndexOf(".")) > -1) {
t=t.substring(i+1,t.length);
cn=(t*1);
}
}
if (cs==0 || _ufns==1) {
t=_uGC(dc,"__utma="+_udh,";");
if ((i=t.lastIndexOf(".")) > 9) {
_uns=t.substring(i+1,t.length);
_uns=(_uns*1);
}
cn++;
if (_uns==0) _uns=1;
_ubd.cookie="__utmz="+_udh+"."+_ust+"."+_uns+"."+cn+"."+c+"; path="+_utcp+"; "+x+_udo;
}
if (cs==0 || _ufns==1) return "&utmcn=1";
else return "&utmcr=1";
}
function _uRef() {
if (_ur=="0" || _ur=="" || _ur=="-") return "";
var i=0,h,k,n;
if ((i=_ur.indexOf("://"))<0) return "";
h=_ur.substring(i+3,_ur.length);
if (h.indexOf("/") > -1) {
k=h.substring(h.indexOf("/"),h.length);
if (k.indexOf("?") > -1) k=k.substring(0,k.indexOf("?"));
h=h.substring(0,h.indexOf("/"));
}
h=h.toLowerCase();
n=h;
if ((i=n.indexOf(":")) > -1) n=n.substring(0,i);
for (var ii=0;ii<_uRno.length;ii++) {
if ((i=n.indexOf(_uRno[ii].toLowerCase())) > -1 && n.length==(i+_uRno[ii].length)) { _ufno=1; break; }
}
if (h.indexOf("www.")==0) h=h.substring(4,h.length);
return "utmccn=(referral)|utmcsr="+_uEC(h)+"|"+"utmcct="+_uEC(k)+"|utmcmd=referral";
}
function _uOrg(t) {
if (_ur=="0" || _ur=="" || _ur=="-") return "";
var i=0,h,k;
if ((i=_ur.indexOf("://")) < 0) return "";
h=_ur.substring(i+3,_ur.length);
if (h.indexOf("/") > -1) {
h=h.substring(0,h.indexOf("/"));
}
for (var ii=0;ii<_uOsr.length;ii++) {
if (h.indexOf(_uOsr[ii]) > -1) {
if ((i=_ur.indexOf("?"+_uOkw[ii]+"=")) > -1 || (i=_ur.indexOf("&"+_uOkw[ii]+"=")) > -1) {
k=_ur.substring(i+_uOkw[ii].length+2,_ur.length);
if ((i=k.indexOf("&")) > -1) k=k.substring(0,i);
for (var yy=0;yy<_uOno.length;yy++) {
if (_uOno[yy].toLowerCase()==k.toLowerCase()) { _ufno=1; break; }
}
if (t) return _uEC(k);
else return "utmccn=(organic)|utmcsr="+_uEC(_uOsr[ii])+"|"+"utmctr="+_uEC(k)+"|utmcmd=organic";
}
}
}
return "";
}
function _uBInfo(page) {
var sr="-",sc="-",ul="-",fl="-",je=1;
var n=navigator;
if (self.screen) {
sr=screen.width+"x"+screen.height;
sc=screen.colorDepth+"-bit";
} else if (self.java) {
var j=java.awt.Toolkit.getDefaultToolkit();
var s=j.getScreenSize();
sr=s.width+"x"+s.height;
}
if (n.language) { ul=n.language.toLowerCase(); }
else if (n.browserLanguage) { ul=n.browserLanguage.toLowerCase(); }
je=n.javaEnabled()?1:0;
if (_uflash) fl=_uFlash();
return "&utmsr="+sr+"&utmsc="+sc+"&utmul="+ul+"&utmje="+je+"&utmfl="+fl;
}
function __utmSetTrans() {
var e;
if (_ubd.getElementById) e=_ubd.getElementById("utmtrans");
else if (_ubd.utmform && _ubd.utmform.utmtrans) e=_ubd.utmform.utmtrans;
if (!e) return;
var l=e.value.split("UTM:");
var i,i2,c;
if (_userv==0 || _userv==2) i=new Array();
if (_userv==1 || _userv==2) { i2=new Array(); c=_uGCS(); }
for (var ii=0;ii l[ii]=_uTrim(l[ii]);
if (l[ii].charAt(0)!='T' && l[ii].charAt(0)!='I') continue;
var r=Math.round(Math.random()*2147483647);
if (!_utsp || _utsp=="") _utsp="|";
var f=l[ii].split(_utsp),s="";
if (f[0].charAt(0)=='T') {
s="&utmt=tran"+"&utmn="+r;
f[1]=_uTrim(f[1]); if(f[1]&&f[1]!="") s+="&utmtid="+escape(f[1]);
f[2]=_uTrim(f[2]); if(f[2]&&f[2]!="") s+="&utmtst="+escape(f[2]);
f[3]=_uTrim(f[3]); if(f[3]&&f[3]!="") s+="&utmtto="+escape(f[3]);
f[4]=_uTrim(f[4]); if(f[4]&&f[4]!="") s+="&utmttx="+escape(f[4]);
f[5]=_uTrim(f[5]); if(f[5]&&f[5]!="") s+="&utmtsp="+escape(f[5]);
f[6]=_uTrim(f[6]); if(f[6]&&f[6]!="") s+="&utmtci="+escape(f[6]);
f[7]=_uTrim(f[7]); if(f[7]&&f[7]!="") s+="&utmtrg="+escape(f[7]);
f[8]=_uTrim(f[8]); if(f[8]&&f[8]!="") s+="&utmtco="+escape(f[8]);
} else {
s="&utmt=item"+"&utmn="+r;
f[1]=_uTrim(f[1]); if(f[1]&&f[1]!="") s+="&utmtid="+escape(f[1]);
f[2]=_uTrim(f[2]); if(f[2]&&f[2]!="") s+="&utmipc="+escape(f[2]);
f[3]=_uTrim(f[3]); if(f[3]&&f[3]!="") s+="&utmipn="+escape(f[3]);
f[4]=_uTrim(f[4]); if(f[4]&&f[4]!="") s+="&utmiva="+escape(f[4]);
f[5]=_uTrim(f[5]); if(f[5]&&f[5]!="") s+="&utmipr="+escape(f[5]);
f[6]=_uTrim(f[6]); if(f[6]&&f[6]!="") s+="&utmiqt="+escape(f[6]);
}
if (_userv==0 || _userv==2) {
i[ii]=new Image(1,1);
i[ii].src=_ugifpath+"?"+"utmwv="+_uwv+s;
i[ii].onload=function() { _uVoid(); }
}
if (_userv==1 || _userv==2) {
i2[ii]=new Image(1,1);
i2[ii].src=_ugifpath2+"?"+"utmwv="+_uwv+s+"&utmac="+_uacct+"&utmcc="+c;
i2[ii].onload=function() { _uVoid(); }
}
}
return;
}
function _uFlash() {
var f="-",n=navigator;
if (n.plugins && n.plugins.length) {
for (var ii=0;ii if (n.plugins[ii].name.indexOf('Shockwave Flash')!=-1) {
f=n.plugins[ii].description.split('Shockwave Flash ')[1];
break;
}
}
} else if (window.ActiveXObject) {
for (var ii=10;ii>=2;ii--) {
try {
var fl=eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash."+ii+"');");
if (fl) { f=ii + '.0'; break; }
}
catch(e) {}
}
}
return f;
}
function __utmLinker(l) {
if (!_ulink) return;
var p,k,a="-",b="-",c="-",z="-",v="-";
var dc=_ubd.cookie;
if (l && l!="") {
if (dc) {
a=escape(_uGC(dc,"__utma="+_udh,";"));
b=escape(_uGC(dc,"__utmb="+_udh,";"));
c=escape(_uGC(dc,"__utmc="+_udh,";"));
z=escape(_uGC(dc,"__utmz="+_udh,";"));
v=escape(_uGC(dc,"__utmv="+_udh,";"));
k=(_uHash(a+b+c+z+v)*1)+(_udh*1);
p="__utma="+a+"&__utmb="+b+"&__utmc="+c+"&__utmz="+z+"&__utmv="+v+"&__utmk="+k;
}
if (p) {
if (l.indexOf("?")<=-1) { document.location=l+"?"+p; }
else { document.location=l+"&"+p; }
} else { document.location=l; }
}
}
function __utmLinkPost(f) {
if (!_ulink) return;
var p,k,a="-",b="-",c="-",z="-",v="-";
var dc=_ubd.cookie;
if (!f || !f.action) return;
if (dc) {
a=escape(_uGC(dc,"__utma="+_udh,";"));
b=escape(_uGC(dc,"__utmb="+_udh,";"));
c=escape(_uGC(dc,"__utmc="+_udh,";"));
z=escape(_uGC(dc,"__utmz="+_udh,";"));
v=escape(_uGC(dc,"__utmv="+_udh,";"));
k=(_uHash(a+b+c+z+v)*1)+(_udh*1);
p="__utma="+a+"&__utmb="+b+"&__utmc="+c+"&__utmz="+z+"&__utmv="+v+"&__utmk="+k;
}
if (p) {
if (f.action.indexOf("?")<=-1) f.action+="?"+p;
else f.action+="&"+p;
}
return;
}
function __utmSetVar(v) {
if (!v || v=="") return;
var r=Math.round(Math.random() * 2147483647);
_ubd.cookie="__utmv="+_udh+"."+escape(v)+"; path="+_utcp+"; expires=Sun, 18 Jan 2038 00:00:00 GMT;"+_udo;
var s="&utmt=var&utmn="+r;
if (_userv==0 || _userv==2) {
var i=new Image(1,1);
i.src=_ugifpath+"?"+"utmwv="+_uwv+s;
i.onload=function() { _uVoid(); }
}
if (_userv==1 || _userv==2) {
var i2=new Image(1,1);
i2.src=_ugifpath2+"?"+"utmwv="+_uwv+s+"&utmac="+_uacct+"&utmcc="+_uGCS();
i2.onload=function() { _uVoid(); }
}
}
function _uGCS() {
var t,c="",dc=_ubd.cookie;
if ((t=_uGC(dc,"__utma="+_udh,";"))!="-") c+=escape("__utma="+t+";+");
if ((t=_uGC(dc,"__utmb="+_udh,";"))!="-") c+=escape("__utmb="+t+";+");
if ((t=_uGC(dc,"__utmc="+_udh,";"))!="-") c+=escape("__utmc="+t+";+");
if ((t=_uGC(dc,"__utmz="+_udh,";"))!="-") c+=escape("__utmz="+t+";+");
if ((t=_uGC(dc,"__utmv="+_udh,";"))!="-") c+=escape("__utmv="+t+";");
if (c.charAt(c.length-1)=="+") c=c.substring(0,c.length-1);
return c;
}
function _uGC(l,n,s) {
if (!l || l=="" || !n || n=="" || !s || s=="") return "-";
var i,i2,i3,c="-";
i=l.indexOf(n);
i3=n.indexOf("=")+1;
if (i > -1) {
i2=l.indexOf(s,i); if (i2 < 0) { i2=l.length; }
c=l.substring((i+i3),i2);
}
return c;
}
function _uDomain() {
if (!_udn || _udn=="" || _udn=="none") { _udn=""; return 1; }
if (_udn=="auto") {
var d=_ubd.domain;
if (d.substring(0,4)=="www.") {
d=d.substring(4,d.length);
}
_udn=d;
}
if (_uhash=="off") return 1;
return _uHash(_udn);
}
function _uHash(d) {
if (!d || d=="") return 1;
var h=0,g=0;
for (var i=d.length-1;i>=0;i--) {
var c=parseInt(d.charCodeAt(i));
h=((h << 6) & 0xfffffff) + c + (c << 14);
if ((g=h & 0xfe00000)!=0) h=(h ^ (g >> 21));
}
return h;
}
function _uFixA(c,s,t) {
if (!c || c=="" || !s || s=="" || !t || t=="") return "-";
var a=_uGC(c,"__utma="+_udh,s);
var lt=0,i=0;
if ((i=a.lastIndexOf(".")) > 9) {
_uns=a.substring(i+1,a.length);
_uns=(_uns*1)+1;
a=a.substring(0,i);
if ((i=a.lastIndexOf(".")) > 7) {
lt=a.substring(i+1,a.length);
a=a.substring(0,i);
}
if ((i=a.lastIndexOf(".")) > 5) {
a=a.substring(0,i);
}
a+="."+lt+"."+t+"."+_uns;
}
return a;
}
function _uTrim(s) {
if (!s || s=="") return "";
while ((s.charAt(0)==' ') || (s.charAt(0)=='\n') || (s.charAt(0,1)=='\r')) s=s.substring(1,s.length);
while ((s.charAt(s.length-1)==' ') || (s.charAt(s.length-1)=='\n') || (s.charAt(s.length-1)=='\r')) s=s.subst
ring(0,s.length-1);
return s;
}
function _uEC(s) {
var n="";
if (!s || s=="") return "";
for (var i=0;i return n;
}
function __utmVisitorCode() {
var r=0,t=0,i=0,i2=0,m=31;
var a=_uGC(_ubd.cookie,"__utma="+_udh,";");
if ((i=a.indexOf(".",0))<0) return;
if ((i2=a.indexOf(".",i+1))>0) r=a.substring(i+1,i2); else return "";
if ((i=a.indexOf(".",i2+1))>0) t=a.substring(i2+1,i); else return "";
var c=new Array('A','B','C','D','E','F','G','H','J','K','L','M','N','P','R','S','T','U','V','W','X','Y','Z','1
','2','3','4','5','6','7','8','9');
return c[r>>28&m]+c[r>>23&m]+c[r>>18&m]+c[r>>13&m]+"-"+c[r>>8&m]+c[r>>3&m]+c[((r&7)<<2)+(t>>30&3)]+c[t>>25&m]+
c[t>>20&m]+"-"+c[t>>15&m]+c[t>>10&m]+c[t>>5&m]+c[t&m];
}
function _uIN(n) {
if (!n) return false;
for (i=0;i var c=n.charAt(i);
if ((c<"0" || c>"9") && (c!=".")) return false;
}
return true;
}
我们曾经或多或少都会碰到过MD5密码文件校验之类的。知道MD5是一种不可逆的加密算法。其实MD5只是hash(哈希)中的一种运算规则。那么除了MD5还有多少种呢?请看下面:
哇!原来hash的运算规则有这么多啊,有好多都是我们所不熟悉的,那么当我们看到一段不规则的字符串的时候,我们如何推断大概是用哪种加密算法生成的呢?请看我们的例子:
希望上面的资料能够给大家一些帮助?phpbr>
引用
print_r(hash_algos());
?>
Array
(
[0] => md4
[1] => md5
[2] => sha1
[3] => sha256
[4] => sha384
[5] => sha512
[6] => ripemd128
[7] => ripemd160
[8] => whirlpool
[9] => tiger128,3
[10] => tiger160,3
[11] => tiger192,3
[12] => tiger128,4
[13] => tiger160,4
[14] => tiger192,4
[15] => snefru
[16] => gost
[17] => adler32
[18] => crc32
[19] => crc32b
[20] => haval128,3
[21] => haval160,3
[22] => haval192,3
[23] => haval224,3
[24] => haval256,3
[25] => haval128,4
[26] => haval160,4
[27] => haval192,4
[28] => haval224,4
[29] => haval256,4
[30] => haval128,5
[31] => haval160,5
[32] => haval192,5
[33] => haval224,5
[34] => haval256,5
)
?>
Array
(
[0] => md4
[1] => md5
[2] => sha1
[3] => sha256
[4] => sha384
[5] => sha512
[6] => ripemd128
[7] => ripemd160
[8] => whirlpool
[9] => tiger128,3
[10] => tiger160,3
[11] => tiger192,3
[12] => tiger128,4
[13] => tiger160,4
[14] => tiger192,4
[15] => snefru
[16] => gost
[17] => adler32
[18] => crc32
[19] => crc32b
[20] => haval128,3
[21] => haval160,3
[22] => haval192,3
[23] => haval224,3
[24] => haval256,3
[25] => haval128,4
[26] => haval160,4
[27] => haval192,4
[28] => haval224,4
[29] => haval256,4
[30] => haval128,5
[31] => haval160,5
[32] => haval192,5
[33] => haval224,5
[34] => haval256,5
)
哇!原来hash的运算规则有这么多啊,有好多都是我们所不熟悉的,那么当我们看到一段不规则的字符串的时候,我们如何推断大概是用哪种加密算法生成的呢?请看我们的例子:
引用
我们对http://www.bizeway.net/加密,结果如下:
md2 = 6052a4afb1c91673a19511d87ca7bf9c
md4 = a4b0885c2b84b05320e3f9ac5f16d888
md5 = 5e886a15279d0b021909736d0c7e4eb5
sha1 = b3ef5fc0b12c90353a7355af157e8b5120194516
sha256 = b959552cc7fab5ed47550ba7c0890585c751d78e7a3f6b6866589a7647e4001b
sha384 = 1b0a29f9859d5a7979c39d19df61ed62670b40c6f751f69b9efac9ced84646d234a2ee1601de13db79823d0f8be04c24
sha512 = 0e2ada52b6955ae9b70b1273bfedc6a8974a3a573cd3dee6cf60b9c97de4c78906ed2deb1a291f147ebe0f4bf192680b1a3bef1e9d72f9dca5fecc7c55dd5fdd
ripemd128 = 1c37bca1b2c3a9cd315336b11da1cc51
ripemd160 = 561c00de12c091d4c213baa861c7021474cedae1
ripemd256 = 34dd5a7b2b5cf633c67964f6a2f36266fe24a3b24f9ba4198f09ec839f241181
ripemd320 = ae7bf6f8d0dfcb8072c2f7f7afbecea397570130fa605bb4ee29d65a4049d5a6d00e030938ad2d0c
whirlpool = 8144f3cb8708ca83b1a14438faab52a4b3857a8793ead44c3accacc127b9615f60365dc146522cbda39298fc299a60524eb5e2779f4aa23ed65b156a2b1f1009
tiger128,3 = 982500b72f18c6390b739d0c7f26010b
tiger160,3 = 982500b72f18c6390b739d0c7f26010b839bbed1
tiger192,3 = 982500b72f18c6390b739d0c7f26010b839bbed1a2cb6f6b
tiger128,4 = 3d08e277ad45ea8954631975e30f5857
tiger160,4 = 3d08e277ad45ea8954631975e30f58576cf28c89
tiger192,4 = 3d08e277ad45ea8954631975e30f58576cf28c89eb4de64a
snefru = 271c5f57081c06887292f8e7d852cc1a9b76bc1948fcb31ed748a76650b8ac61
gost = 7344f382e8af17c61e1cd6998d6ad636960f8bcaeeb5c8994130811cce082627
adler32 = 8b082c67
crc32 = f2a81a53
crc32b = ba25f4f1
haval128,3 = d82c54644cca5c6c9b523e8a58089165
haval160,3 = a56db9796f5e54618c3cf8e74719038e525473df
haval192,3 = d56cc89a444810f8c36475a60c8170ced52692a27f9deffb
haval224,3 = fa2759e6289d1b4231df611af6f00a18338964c5e0100aa15975fc02
haval256,3 = 1ec91a5cb89170eb7c185105802850f97a4cf60aa7a3511a8e37a5db804e9917
haval128,4 = aac659a7e7e8f8f5262803d9b49233c4
haval160,4 = e202b7ddeef36e14c5bf8e2e021af865f82c7710
haval192,4 = c7d0dae89617abcc4880e835898de662e22c372fb364d1c4
haval224,4 = 30d8772a3ff47cbc616a58711c4de4555aa04791141f3859d74c5150
haval256,4 = 7748ebecc45adff32b42608f43775fe0803abc908793061cb05923f7d356d303
haval128,5 = 7cd16ab3dd2c05ac2c8c61efd63ea3cb
haval160,5 = 83d38a838eabd27582e423ce31767abc75b4292b
haval192,5 = 1298d602d4761d895f664baa74392b1f544ce1ead2dcc3ad
haval224,5 = a306fe5b1947c39989a23c578f066625d78e0f8a4bd99cbb837f6c40
haval256,5 = a4256c1f4415376340f3ac48e0c26ce9d109297f034392c0341863f5c514eb94
md2 = 6052a4afb1c91673a19511d87ca7bf9c
md4 = a4b0885c2b84b05320e3f9ac5f16d888
md5 = 5e886a15279d0b021909736d0c7e4eb5
sha1 = b3ef5fc0b12c90353a7355af157e8b5120194516
sha256 = b959552cc7fab5ed47550ba7c0890585c751d78e7a3f6b6866589a7647e4001b
sha384 = 1b0a29f9859d5a7979c39d19df61ed62670b40c6f751f69b9efac9ced84646d234a2ee1601de13db79823d0f8be04c24
sha512 = 0e2ada52b6955ae9b70b1273bfedc6a8974a3a573cd3dee6cf60b9c97de4c78906ed2deb1a291f147ebe0f4bf192680b1a3bef1e9d72f9dca5fecc7c55dd5fdd
ripemd128 = 1c37bca1b2c3a9cd315336b11da1cc51
ripemd160 = 561c00de12c091d4c213baa861c7021474cedae1
ripemd256 = 34dd5a7b2b5cf633c67964f6a2f36266fe24a3b24f9ba4198f09ec839f241181
ripemd320 = ae7bf6f8d0dfcb8072c2f7f7afbecea397570130fa605bb4ee29d65a4049d5a6d00e030938ad2d0c
whirlpool = 8144f3cb8708ca83b1a14438faab52a4b3857a8793ead44c3accacc127b9615f60365dc146522cbda39298fc299a60524eb5e2779f4aa23ed65b156a2b1f1009
tiger128,3 = 982500b72f18c6390b739d0c7f26010b
tiger160,3 = 982500b72f18c6390b739d0c7f26010b839bbed1
tiger192,3 = 982500b72f18c6390b739d0c7f26010b839bbed1a2cb6f6b
tiger128,4 = 3d08e277ad45ea8954631975e30f5857
tiger160,4 = 3d08e277ad45ea8954631975e30f58576cf28c89
tiger192,4 = 3d08e277ad45ea8954631975e30f58576cf28c89eb4de64a
snefru = 271c5f57081c06887292f8e7d852cc1a9b76bc1948fcb31ed748a76650b8ac61
gost = 7344f382e8af17c61e1cd6998d6ad636960f8bcaeeb5c8994130811cce082627
adler32 = 8b082c67
crc32 = f2a81a53
crc32b = ba25f4f1
haval128,3 = d82c54644cca5c6c9b523e8a58089165
haval160,3 = a56db9796f5e54618c3cf8e74719038e525473df
haval192,3 = d56cc89a444810f8c36475a60c8170ced52692a27f9deffb
haval224,3 = fa2759e6289d1b4231df611af6f00a18338964c5e0100aa15975fc02
haval256,3 = 1ec91a5cb89170eb7c185105802850f97a4cf60aa7a3511a8e37a5db804e9917
haval128,4 = aac659a7e7e8f8f5262803d9b49233c4
haval160,4 = e202b7ddeef36e14c5bf8e2e021af865f82c7710
haval192,4 = c7d0dae89617abcc4880e835898de662e22c372fb364d1c4
haval224,4 = 30d8772a3ff47cbc616a58711c4de4555aa04791141f3859d74c5150
haval256,4 = 7748ebecc45adff32b42608f43775fe0803abc908793061cb05923f7d356d303
haval128,5 = 7cd16ab3dd2c05ac2c8c61efd63ea3cb
haval160,5 = 83d38a838eabd27582e423ce31767abc75b4292b
haval192,5 = 1298d602d4761d895f664baa74392b1f544ce1ead2dcc3ad
haval224,5 = a306fe5b1947c39989a23c578f066625d78e0f8a4bd99cbb837f6c40
haval256,5 = a4256c1f4415376340f3ac48e0c26ce9d109297f034392c0341863f5c514eb94
希望上面的资料能够给大家一些帮助?phpbr>
跟着ArthurXF学Alexa作弊10——google-analytics cookies原理分析
2007/11/17 14:36 ArthurXF
因为最近alexa加入了google-analytics的cookies在里面,所以为了万无一失,我们必须模拟google-analytics的cookies,下面是我转载过来对google-analytics的cookies分析,希望对大家有些帮助。
经过上面的数据整理,我们找出alexa需要的cookies:
alexa里面只有__utma和__utmz,例如:
__utma=115222615.1251140172.1191286648.1193849008.1195232899.14;
__utmz=115222615.1191673134.10.2.utmccn=(referral)|utmcsr=info.alexa.com|utmcct=/data/details/traffic_details|utmcmd=referral;
那我们就重点分析一下如何模拟__utma和__utmz。
__utma分析如下:
__utmz的分析如下:
上面的分析不一定是完全正确,如果大家还有其他的什么好建议,可以跟我联系,QQ:20911218,MSN:onenight11@hotmail.com
现在ArthurXF本人正在搞PHP等技术培训,如果想学习的人可以跟我联系。另外培训的招生简章在这个网址,想了解的可以去看看。
PHP培训招生简章
引用
# 发统计包
--------------------------------------------------------------------------------
GET http://www.google-analytics.com/__utm.gif?utmwv=1&utmn=1261523910&utmcs=gb2312&utmsr=1400x1050&utmsc=32-bit&utmul=en-us&utmje=1&utmfl=-&utmhn=www.mydll.com&utmr=-&utmp=/gg.htm&utmac=UA-2789145-1&utmcc=__utma%3D251296922.1430927915.1192194210.1192194210.1192194210.1%3B%2B__utmb%3D251296922%3B%2B__utmc%3D251296922%3B%2B__utmz%3D251296922.1192194210.1.1.utmccn%3D(direct)%7Cutmcsr%3D(direct)%7Cutmcmd%3D(none)%3B%2B HTTP/1.1
Accept: */*
Referer: http://www.mydll.com/gg.htm
Accept-Language: zh-cn
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Connection: Keep-Alive
Host: www.google-analytics.com
Pragma: no-cache
HTTP/1.1 200 OK
Pragma: no-cache
Cache-Control: private, no-cache, no-cache="Set-Cookie", proxy-revalidate
Expires: Fri, 04 Aug 1978 12:00:00 GMT
Content-Type: image/gif
Server: ucfe
Content-Length: 35
Date: Fri, 12 Oct 2007 13:04:04 GMT
Via: 1.1 HttpSpy
# 发出统计的请求详细分析
--------------------------------------------------------------------------------
http://www.google-analytics.com/__utm.gif?
utmwv=1& # 常量 1
utmn=1261523910& # Math.round(Math.random()*2147483647);
utmcs=gb2312& # charset
utmsr=1400x1050& # screen
utmsc=32-bit& # screen.colorDepth
utmul=en-us& # navigator.language.toLowerCase();
utmje=1& # navigator.javaEnabled() ? 1 : 0;
utmfl=-& # _uFlash
utmhn=www.mydll.com& # JsUrlEncode(location.hostname)
utmr=-& # document.referrer
utmp=/gg.htm& # location.pathname+location.search; 或者优先是 用户输入的 page 页面
utmac=UA-2789145-1& # 站点ID,用户输入的 _uacct = "UA-2789145-1";
utmcc=__utma%3D251296922.1430927915.1192194210.1192194210.1192194210.1%3B%2B__utmb%3D251296922%3B%2B__utmc%3D251296922%3B%2B__utmz%3D251296922.1192194210.1.1.utmccn%3D(direct)%7Cutmcsr%3D(direct)%7Cutmcmd%3D(none)%3B%2B
utmcc=__utma=251296922.1430927915.1192194210.1192194210.1192194210.1;+__utmb=251296922;+__utmc=251296922;+__utmz=251296922.1192194210.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none);+
utmcc=
__utma=251296922.1430927915.1192194210.1192194210.1192194210.1;+
__utmb=251296922;+
__utmc=251296922;+
__utmz=251296922.1192194210.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none);+
其中的 251296922 是根据当前页面的根域名计算出来的 HASH 值,例如本次请求是用 mydll.com 计算出来的值 251296922
__utma 的第二个数值 1430927915 是随机数字,用函数 Math.round(Math.random()*2147483647) 生成出来的
__utma 的第三、四、五个数值 1192194210 是随机数字,是用函数 _ust=Math.round((new Date()).getTime()/1000); 计算出来的
__utma 的第六个数值 1 是固定的常量
__utmz 的第一个数是域名的 HASH 值
__utmz 的第二个数值 1192194210 是随机数字,是用函数 _ust=Math.round((new Date()).getTime()/1000); 计算出来的
__utmz 的第三个数值 1 其实就是 __utma 的第六个固定常量
__utmz 的第四个数值 1 在第一次请求的时候是 1,我们就暂时不考虑第二次的请求
__utmz 的最后一个参数 utmccn=(direct)|utmcsr=(direct)|utmcmd=(none) 是表示来源等信息,默认就是这个
当链接是从其他网站点入时,其 __utmz 参数如下:
__utmz=251296922.1192220231.1.1.utmccn=(referral)|utmcsr=yx8.com|utmcct=/temp/togg.html|utmcmd=referral;+
utmccn - 的值表示有来源
utmcsr - 表示来源的跟域名
utmcct - 表示来源页面的 PATH
utmcmd - 表示一个命令好像,这里设置了 referral,可能是为了配合签名的
--------------------------------------------------------------------------------
GET http://www.google-analytics.com/__utm.gif?utmwv=1&utmn=1261523910&utmcs=gb2312&utmsr=1400x1050&utmsc=32-bit&utmul=en-us&utmje=1&utmfl=-&utmhn=www.mydll.com&utmr=-&utmp=/gg.htm&utmac=UA-2789145-1&utmcc=__utma%3D251296922.1430927915.1192194210.1192194210.1192194210.1%3B%2B__utmb%3D251296922%3B%2B__utmc%3D251296922%3B%2B__utmz%3D251296922.1192194210.1.1.utmccn%3D(direct)%7Cutmcsr%3D(direct)%7Cutmcmd%3D(none)%3B%2B HTTP/1.1
Accept: */*
Referer: http://www.mydll.com/gg.htm
Accept-Language: zh-cn
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Connection: Keep-Alive
Host: www.google-analytics.com
Pragma: no-cache
HTTP/1.1 200 OK
Pragma: no-cache
Cache-Control: private, no-cache, no-cache="Set-Cookie", proxy-revalidate
Expires: Fri, 04 Aug 1978 12:00:00 GMT
Content-Type: image/gif
Server: ucfe
Content-Length: 35
Date: Fri, 12 Oct 2007 13:04:04 GMT
Via: 1.1 HttpSpy
# 发出统计的请求详细分析
--------------------------------------------------------------------------------
http://www.google-analytics.com/__utm.gif?
utmwv=1& # 常量 1
utmn=1261523910& # Math.round(Math.random()*2147483647);
utmcs=gb2312& # charset
utmsr=1400x1050& # screen
utmsc=32-bit& # screen.colorDepth
utmul=en-us& # navigator.language.toLowerCase();
utmje=1& # navigator.javaEnabled() ? 1 : 0;
utmfl=-& # _uFlash
utmhn=www.mydll.com& # JsUrlEncode(location.hostname)
utmr=-& # document.referrer
utmp=/gg.htm& # location.pathname+location.search; 或者优先是 用户输入的 page 页面
utmac=UA-2789145-1& # 站点ID,用户输入的 _uacct = "UA-2789145-1";
utmcc=__utma%3D251296922.1430927915.1192194210.1192194210.1192194210.1%3B%2B__utmb%3D251296922%3B%2B__utmc%3D251296922%3B%2B__utmz%3D251296922.1192194210.1.1.utmccn%3D(direct)%7Cutmcsr%3D(direct)%7Cutmcmd%3D(none)%3B%2B
utmcc=__utma=251296922.1430927915.1192194210.1192194210.1192194210.1;+__utmb=251296922;+__utmc=251296922;+__utmz=251296922.1192194210.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none);+
utmcc=
__utma=251296922.1430927915.1192194210.1192194210.1192194210.1;+
__utmb=251296922;+
__utmc=251296922;+
__utmz=251296922.1192194210.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none);+
其中的 251296922 是根据当前页面的根域名计算出来的 HASH 值,例如本次请求是用 mydll.com 计算出来的值 251296922
__utma 的第二个数值 1430927915 是随机数字,用函数 Math.round(Math.random()*2147483647) 生成出来的
__utma 的第三、四、五个数值 1192194210 是随机数字,是用函数 _ust=Math.round((new Date()).getTime()/1000); 计算出来的
__utma 的第六个数值 1 是固定的常量
__utmz 的第一个数是域名的 HASH 值
__utmz 的第二个数值 1192194210 是随机数字,是用函数 _ust=Math.round((new Date()).getTime()/1000); 计算出来的
__utmz 的第三个数值 1 其实就是 __utma 的第六个固定常量
__utmz 的第四个数值 1 在第一次请求的时候是 1,我们就暂时不考虑第二次的请求
__utmz 的最后一个参数 utmccn=(direct)|utmcsr=(direct)|utmcmd=(none) 是表示来源等信息,默认就是这个
当链接是从其他网站点入时,其 __utmz 参数如下:
__utmz=251296922.1192220231.1.1.utmccn=(referral)|utmcsr=yx8.com|utmcct=/temp/togg.html|utmcmd=referral;+
utmccn - 的值表示有来源
utmcsr - 表示来源的跟域名
utmcct - 表示来源页面的 PATH
utmcmd - 表示一个命令好像,这里设置了 referral,可能是为了配合签名的
引用
# 外部链接导入包
--------------------------------------------------------------------------------
GET http://www.google-analytics.com/__utm.gif?utmwv=1&utmn=1389663121&utmcs=gb2312&utmsr=1400x1050&utmsc=32-bit&utmul=en-us&utmje=1&utmfl=-&utmcn=1&utmhn=www.mydll.com&utmr=http://www.yx8.com/temp/togg.html&utmp=/gg.htm&utmac=UA-2789145-1&utmcc=__utma%3D251296922.1389663121.1192220231.1192220231.1192220231.1%3B%2B__utmb%3D251296922%3B%2B__utmc%3D251296922%3B%2B__utmz%3D251296922.1192220231.1.1.utmccn%3D(referral)%7Cutmcsr%3Dyx8.com%7Cutmcct%3D%2Ftemp%2Ftogg.html%7Cutmcmd%3Dreferral%3B%2B HTTP/1.1
Accept: */*
Referer: http://www.mydll.com/gg.htm
Accept-Language: zh-cn
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Connection: Keep-Alive
Host: www.google-analytics.com
HTTP/1.1 200 OK
Pragma: no-cache
Cache-Control: private, no-cache, no-cache="Set-Cookie", proxy-revalidate
Expires: Fri, 04 Aug 1978 12:00:00 GMT
Content-Type: image/gif
Server: ucfe
Content-Length: 35
Date: Fri, 12 Oct 2007 20:17:14 GMT
Via: 1.1 HttpSpy
# 参数分析
--------------------------------------------------------------------------------
http://www.google-analytics.com/__utm.gif?
utmwv=1&
utmn=1389663121&
utmcs=gb2312&
utmsr=1400x1050&
utmsc=32-bit&
utmul=en-us&
utmje=1&
utmfl=-&
utmcn=1&
utmhn=www.mydll.com&
utmr=http://www.yx8.com/temp/togg.html&
utmp=/gg.htm&
utmac=UA-2789145-1&
utmcc=__utma%3D251296922.1389663121.1192220231.1192220231.1192220231.1%3B%2B__utmb%3D251296922%3B%2B__utmc%3D251296922%3B%2B__utmz%3D251296922.1192220231.1.1.utmccn%3D(referral)%7Cutmcsr%3Dyx8.com%7Cutmcct%3D%2Ftemp%2Ftogg.html%7Cutmcmd%3Dreferral%3B%2B
utmcc=__utma=251296922.1389663121.1192220231.1192220231.1192220231.1;+__utmb=251296922;+__utmc=251296922;+__utmz=251296922.1192220231.1.1.utmccn=(referral)|utmcsr=yx8.com|utmcct=/temp/togg.html|utmcmd=referral;+
utmcc=
__utma=251296922.1389663121.1192220231.1192220231.1192220231.1;+
__utmb=251296922;+
__utmc=251296922;+
__utmz=251296922.1192220231.1.1.utmccn=(referral)|utmcsr=yx8.com|utmcct=/temp/togg.html|utmcmd=referral;+
--------------------------------------------------------------------------------
GET http://www.google-analytics.com/__utm.gif?utmwv=1&utmn=1389663121&utmcs=gb2312&utmsr=1400x1050&utmsc=32-bit&utmul=en-us&utmje=1&utmfl=-&utmcn=1&utmhn=www.mydll.com&utmr=http://www.yx8.com/temp/togg.html&utmp=/gg.htm&utmac=UA-2789145-1&utmcc=__utma%3D251296922.1389663121.1192220231.1192220231.1192220231.1%3B%2B__utmb%3D251296922%3B%2B__utmc%3D251296922%3B%2B__utmz%3D251296922.1192220231.1.1.utmccn%3D(referral)%7Cutmcsr%3Dyx8.com%7Cutmcct%3D%2Ftemp%2Ftogg.html%7Cutmcmd%3Dreferral%3B%2B HTTP/1.1
Accept: */*
Referer: http://www.mydll.com/gg.htm
Accept-Language: zh-cn
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Connection: Keep-Alive
Host: www.google-analytics.com
HTTP/1.1 200 OK
Pragma: no-cache
Cache-Control: private, no-cache, no-cache="Set-Cookie", proxy-revalidate
Expires: Fri, 04 Aug 1978 12:00:00 GMT
Content-Type: image/gif
Server: ucfe
Content-Length: 35
Date: Fri, 12 Oct 2007 20:17:14 GMT
Via: 1.1 HttpSpy
# 参数分析
--------------------------------------------------------------------------------
http://www.google-analytics.com/__utm.gif?
utmwv=1&
utmn=1389663121&
utmcs=gb2312&
utmsr=1400x1050&
utmsc=32-bit&
utmul=en-us&
utmje=1&
utmfl=-&
utmcn=1&
utmhn=www.mydll.com&
utmr=http://www.yx8.com/temp/togg.html&
utmp=/gg.htm&
utmac=UA-2789145-1&
utmcc=__utma%3D251296922.1389663121.1192220231.1192220231.1192220231.1%3B%2B__utmb%3D251296922%3B%2B__utmc%3D251296922%3B%2B__utmz%3D251296922.1192220231.1.1.utmccn%3D(referral)%7Cutmcsr%3Dyx8.com%7Cutmcct%3D%2Ftemp%2Ftogg.html%7Cutmcmd%3Dreferral%3B%2B
utmcc=__utma=251296922.1389663121.1192220231.1192220231.1192220231.1;+__utmb=251296922;+__utmc=251296922;+__utmz=251296922.1192220231.1.1.utmccn=(referral)|utmcsr=yx8.com|utmcct=/temp/togg.html|utmcmd=referral;+
utmcc=
__utma=251296922.1389663121.1192220231.1192220231.1192220231.1;+
__utmb=251296922;+
__utmc=251296922;+
__utmz=251296922.1192220231.1.1.utmccn=(referral)|utmcsr=yx8.com|utmcct=/temp/togg.html|utmcmd=referral;+
引用
# 再次刷新页面时发现 Cookie 已经设置上
--------------------------------------------------------------------------------
GET http://www.mydll.com/51la.htm HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
Accept-Language: zh-cn
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Host: www.mydll.com
Connection: Keep-Alive
Cookie: __utma=251296922.1389663121.1192220231.1192220231.1192220231.1; __utmb=251296922; __utmc=251296922; __utmz=251296922.1192220231.1.1.utmccn=(referral)|utmcsr=yx8.com|utmcct=/temp/togg.html|utmcmd=referral
--------------------------------------------------------------------------------
GET http://www.mydll.com/51la.htm HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
Accept-Language: zh-cn
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Host: www.mydll.com
Connection: Keep-Alive
Cookie: __utma=251296922.1389663121.1192220231.1192220231.1192220231.1; __utmb=251296922; __utmc=251296922; __utmz=251296922.1192220231.1.1.utmccn=(referral)|utmcsr=yx8.com|utmcct=/temp/togg.html|utmcmd=referral
经过上面的数据整理,我们找出alexa需要的cookies:
引用
alexa里面只有__utma和__utmz,例如:
__utma=115222615.1251140172.1191286648.1193849008.1195232899.14;
__utmz=115222615.1191673134.10.2.utmccn=(referral)|utmcsr=info.alexa.com|utmcct=/data/details/traffic_details|utmcmd=referral;
那我们就重点分析一下如何模拟__utma和__utmz。
__utma分析如下:
引用
__utma 的第一个数值是域名的hash值;
__utma 的第二个数值 1251140172 是随机数字,用函数 Math.round(Math.random()*2147483647) 生成出来的;
__utma 的第三、四、五个数值 1192194210 是随机数字,是用函数 _ust=Math.round((new Date()).getTime()/1000); 计算出来的;
__utma 的第六个数值 1 是固定的常量;
__utma 的第二个数值 1251140172 是随机数字,用函数 Math.round(Math.random()*2147483647) 生成出来的;
__utma 的第三、四、五个数值 1192194210 是随机数字,是用函数 _ust=Math.round((new Date()).getTime()/1000); 计算出来的;
__utma 的第六个数值 1 是固定的常量;
__utmz的分析如下:
引用
__utmz 的第一个数是域名的 HASH 值
__utmz 的第二个数值 1192194210 是随机数字,是用函数 _ust=Math.round((new Date()).getTime()/1000); 计算出来的
__utmz 的第三个数值 1 其实就是 __utma 的第六个固定常量
__utmz 的第四个数值 1 在第一次请求的时候是 1,我们就暂时不考虑第二次的请求
__utmz 的最后一个参数 utmccn=(direct)|utmcsr=(direct)|utmcmd=(none) 是表示来源等信息,默认就是这个
__utmz 的第二个数值 1192194210 是随机数字,是用函数 _ust=Math.round((new Date()).getTime()/1000); 计算出来的
__utmz 的第三个数值 1 其实就是 __utma 的第六个固定常量
__utmz 的第四个数值 1 在第一次请求的时候是 1,我们就暂时不考虑第二次的请求
__utmz 的最后一个参数 utmccn=(direct)|utmcsr=(direct)|utmcmd=(none) 是表示来源等信息,默认就是这个
上面的分析不一定是完全正确,如果大家还有其他的什么好建议,可以跟我联系,QQ:20911218,MSN:onenight11@hotmail.com
现在ArthurXF本人正在搞PHP等技术培训,如果想学习的人可以跟我联系。另外培训的招生简章在这个网址,想了解的可以去看看。
PHP培训招生简章