台灣最大程式設計社群網站
線上人數
597
 
會員總數:245981
討論主題:189559
歡迎您免費加入會員
討論區列表 >> 專欄文章 >> Remote Script 用XMLHTTP達成
[]  
[我要回覆]
回應主題 加入我的關注話題 檢舉此篇討論 將提問者加入個人黑名單
Remote Script 用XMLHTTP達成
價值 : 0 QP  點閱數:554 回應數:0
樓主

站務人員 站長
門外漢
0 1580
542 9
發送站內信

捐贈 VP 給 站務人員

login.htm :

<xml id="Detailsdso">
<?xml version="1.0"?>
<webcheck>
<webname>
</webname>
</webcheck>
</xml>
<script language="vbscript">
dim docsubmit
sub built_onclick
set docsubmit = createobject ("microsoft.xmldom")
docsubmit.async = false
docsubmit.loadXML "<?xml version='1.0'?>" &_
"<webname>" &_
"<username>" &_
webguestname.value &_
"</username>" &_
"<password>" &_
webpassworda.value &_
"</password>" &_
"</webname>"
set docorder = Detailsdso.XMLDocument
set nodeOrder = docorder.documentElement
set poster = createobject ("Microsoft.XMLHTTP")
poster.open "POST", "webchkname.asp", False
poster.send docSubmit
msgbox poster.responseText,,"Login Message Response"
end sub
</script>

<body bgcolor="#ffffff" topmargin=0 leftmargin=0>
<table border="0" cellpadding="0" cellspacing="1">
<tr>
<td>USERNAME</td>
<td><input type="text" size="12" name="webguestname" value=""
style="font-family: verdana, geneva, ms sans serif, arial;font-size: 11px;">
</td>
<td rowspan="2" valign=top>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign=top>
<input type="image" name="built" src="images/key1.gif" border="0">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>PASSWORD</td>
<td><input type="password" size="12" name="webpassworda" value=""
style="font-family: verdana, geneva, ms sans serif, arial;font-size: 11px;">
</td>
</tr>
</table>
</body>
</html>


webchkname.asp :

<% set docReceived = server.createobject ("microsoft.xmldom")
docReceived.async = false
docReceived.load request

set nodeCustomer = docReceived.selectSinglenode ("//username")
username = nodeCustomer.firstchild.nodevalue
set nodeCustomer = docReceived.selectSinglenode ("//password")
password = nodeCustomer.firstchild.nodevalue
if trim(username)="" or trim(password)="" then
response.write "Please enter the necessary register information."
response.end
end if %>
<!--#include virtual="databaselink.inc"-->
<% set rs = conn1.execute ("select * from database where password='"&password&"' and username='"&username&"'")
if rs.eof then
response.write "Uncorrect username & password,please rewrite again !"
else
response.write "Login Success !"
end if
rs.close
conn1.close
set rs=nothing
set conn1=nothing %>



--------------------------------------------------------------------------------

本篇文章發表於2002-06-05 00:00
目前尚無任何回覆
   

回覆
如要回應,請先登入.