|
<html> <head> <title>登记</title> <HTA:Application caption="no" windowstate="maximize"> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <SCRIPT language=javascript> var url="http://xxjs.nhedu.net/disks/dnsdj/index.asp";//请修改成你的URL地址 var xmlhttp; function createXMLHTTPReaquest(){ if(window.ActiveXObject){ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }else if(window.XMLHTTPRequest){ xmlhttp=new XMLHTTPRequest(); } } function callserver(){ var userName=document.getElementById("userName").value; if (userName==""){ alert("请输入你的姓名!"); document.getElementById("userName").focus(); }else{ tisi.innerHTML="<font color=red>正在提交,请等待...</font>"; createXMLHTTPReaquest(); ComputerName=showComputerName.innerText; sql=url+"?ComputerName="+ComputerName+"&userName="+userName; xmlhttp.onreadystatechange = updatePage; xmlhttp.open("POST",sql,true); xmlhttp.send(null); } } function updatePage() { if (xmlhttp.readyState == 4){ if (xmlhttp.status == 200){ if(xmlhttp.responseText=="dengjiok"){ tisi.innerText=""; alert("登记成功!"); self.close(); }else{ alert("登记不成功,请检查原因:\n"+xmlhttp.responseText); tisi.innerText="<button onClick='callserver()'>提交</button>"; } }else{ alert("错误代码:"+xmlhttp.status); tisi.innerText="<button onClick='callserver()'>提交</button>"; } } } function show(){ var WshNetwork = new ActiveXObject("WScript.Network"); showComputerName.innerText=WshNetwork.ComputerName; } </SCRIPT> </head> <body onLoad="show()"> <p> </p> <table width="350" border="0" align="center" cellpadding="9" cellspacing="1" bgcolor="#999999"> <tr> <td height="40" colspan="2" align="center" bgcolor="#CCCCCC"><B>请 输 入 你 的 姓 名</B></td> </tr> <tr> <td align="right" bgcolor="#CCCCCC">计算机名:</td> <td bgcolor="#CCCCCC" id="showComputerName"> </td> </tr> <tr> <td align="right" bgcolor="#CCCCCC">姓 名:</td> <td bgcolor="#CCCCCC"> <input name="userName" type="text" id="userName" size="15" maxlength="12"></td> </tr> <tr> <td colspan="2" align="center" bgcolor="#CCCCCC" id="tisi"><button onClick="callserver()">提交</button></td> </tr> </table> </body> </html>
|