loadstatustext = '
'; function makePOSTAddRequest(url,tiepnhan,parameters) { el = document.getElementById(tiepnhan); http_request = false; if (window.XMLHttpRequest) { // Mozilla, Safari,... http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { // set type accordingly to anticipated content type //http_request.overrideMimeType('text/xml'); http_request.overrideMimeType('text/html'); } } else if (window.ActiveXObject) { // IE try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request) { alert('Cannot create XMLHTTP instance'); return false; } http_request.onreadystatechange = alertAdd; http_request.open('POST', url, true); http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http_request.setRequestHeader("Content-length", parameters.length); http_request.setRequestHeader("Connection", "close"); http_request.send(parameters); } function alertAdd() { el.innerHTML = loadstatustext; if (http_request.readyState == 4) { if (http_request.status == 200) { //alert(http_request.responseText); result = http_request.responseText; el.innerHTML = result; } else { alert('There was a problem with the request.'); } } } function dangnhap(obj) { var csname = document.login.name.value; csname = encodeURIComponent(csname); cspassword = document.login.password.value; cspassword = encodeURIComponent(cspassword); csremember = document.login.remember.value; csremember = encodeURIComponent(csremember); var poststr = "name="+csname+"&password="+cspassword+"&remember="+csremember; makePOSTAddRequest("login.php?view=login","login",poststr); } function vietnk(obj) { var csaid_user = document.mydiary.aid_user.value; csaid_user = encodeURIComponent(csaid_user); csatitle = document.mydiary.atitle.value; csatitle = encodeURIComponent(csatitle); csacontent = document.mydiary.acontent.value; csacontent = encodeURIComponent(csacontent); csashow = document.mydiary.ashow.value; csashow = encodeURIComponent(csashow); var poststr = "aid_user="+csaid_user+"&atitle="+csatitle+"&acontent="+csacontent+"&ashow="+csashow; makePOSTAddRequest("vietnk.php","hethong",poststr); } function nganluong(obj) { var csmoney= document.payment.money.value; csmoney = encodeURIComponent(csmoney); csuseridok= document.payment.userid.value; csuseridok = encodeURIComponent(csuseridok); csusername= document.payment.username.value; csusername = encodeURIComponent(csusername); var poststr = "money="+csmoney+"&userid="+csuseridok+"&username="+csusername; makePOSTAddRequest('nganluong/index.php?act=do&','hethong',poststr); } function dangky(obj) { var csnick= document.register.nick.value; csnick = encodeURIComponent(csnick); cspassword = document.register.password.value; cspassword = encodeURIComponent(cspassword); cspassword2 = document.register.password2.value; cspassword2 = encodeURIComponent(cspassword2); csemail = document.register.email.value; csemail = encodeURIComponent(csemail); csname = document.register.name.value; csname = encodeURIComponent(csname); cscapcha = document.register.capcha.value; cscapcha = encodeURIComponent(cscapcha); csinterest = document.register.interest.value; csinterest= encodeURIComponent(csinterest); refcode = document.register.refcode.value; refcode= encodeURIComponent(refcode); var poststr = "nick="+csnick+"&password="+cspassword+"&password2="+cspassword2+"&email="+csemail+"&name="+csname+"&capcha="+cscapcha+"&interest="+csinterest+"&refcode="+refcode; makePOSTAddRequest('register.php?act=do','hethong',poststr); } function send_money(obj) { var my_id1 = document.paymoney.id1.value; my_id1 = encodeURIComponent(my_id1); my_id2 = document.paymoney.id2.value; my_id2 = encodeURIComponent(my_id2); my_moneyvalue = document.paymoney.moneyvalue.value; my_moneyvalue = encodeURIComponent(my_moneyvalue); cscapcha = document.paymoney.capcha.value; cscapcha = encodeURIComponent(cscapcha); var poststr = "id1="+my_id1+"&id2="+my_id2+"&money="+my_moneyvalue+"&capcha="+cscapcha; makePOSTAddRequest('paymoney.php?act=do','hethong',poststr); } function thaypass(obj) { var csoldpass= document.changepass.oldpass.value; csoldpass = encodeURIComponent(csoldpass); csnewpass = document.changepass.newpass.value; csnewpass = encodeURIComponent(csnewpass); csnewpass2 = document.changepass.newpass2.value; csnewpass2 = encodeURIComponent(csnewpass2); var poststr = "oldpass="+csoldpass+"&newpass="+csnewpass+"&newpass2="+csnewpass2; makePOSTAddRequest('usercp.php?act=changepass','trangthaithaypass',poststr); } function thayinfo(obj) { var csemail = document.changeinfo.email.value; csemail = encodeURIComponent(csemail); csname = document.changeinfo.name.value; csname = encodeURIComponent(csname); csinterest = document.changeinfo.interest.value; csinterest= encodeURIComponent(csinterest); var poststr = "email="+csemail+"&name="+csname+"&interest="+csinterest; makePOSTAddRequest('usercp.php?act=changeinfo','trangthaithayinfo',poststr); } function timtencakhuc(obj) { var cstenbaihat= document.timkiem.tenbaihat.value; cstenbaihat = encodeURIComponent(cstenbaihat); var poststr = "tenbaihat="+cstenbaihat; makePOSTAddRequest('search.php?act=cakhuc','baihat',poststr); } function sendmail(obj) { var csid= document.quatang.id.value; csid = encodeURIComponent(csid); cssong = document.quatang.song.value; cssong = encodeURIComponent(cssong); cssinger= document.quatang.singer.value; cssinger= encodeURIComponent(cssinger); csname1 = document.quatang.name1.value; csname1 = encodeURIComponent(csname1); csemail1 = document.quatang.email1.value; csemail1 = encodeURIComponent(csemail1); csname2 = document.quatang.name2.value; csname2 = encodeURIComponent(csname2); csemail2 = document.quatang.email2.value; csemail2 = encodeURIComponent(csemail2); cscontent = document.quatang.content.value; cscontent = encodeURIComponent(cscontent); var poststr = "id="+csid+"&song="+cssong+"&singer="+cssinger+"&name1="+csname1+"&email1="+csemail1+"&name2="+csname2+"&email2"+csemail2+"&content="+cscontent; makePOSTAddRequest('sendmail.php','guimail',poststr); } loadstatustext = '
'; function ajaxLoad(url,id) { if (document.getElementById) { var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); } if (x) { x.onreadystatechange = function() { el = document.getElementById(id); el.innerHTML = loadstatustext; if (x.readyState == 4 && x.status == 200) { el.innerHTML = x.responseText; } } x.open("GET", url, true); x.send(null); } }