如果出现ITEM ID NOT FOUND = 722等字样,请记住722这个,添在下面物品代码处 本文来自织梦
<form action="qlok.asp" method=post>
账 号<INPUT name=username type=text class="lanyu" size=17 maxLength=16>
密 码INPUT name=userpass type=password class="lanyu" size=17 maxLength=16>
角色名<input name=juesename type=text class="lanyu" id="pwd" size=17 maxlength=16>
物品代码<input name=wpcode type=text class="lanyu" id="pwd" size=17 maxlength=16>
</form> 内容来自dedecms
===================以上保存为ql.htm即可 内容来自dedecms
下面是qlok.asp dedecms.com
=============================
<% 织梦好,好织梦
dim conn,connstr,connServerName,connDatabase,connUserName,connPassword
'修改以下信息以适合你的
'---------------------------------------------------------------------------
connServerName = "(local)" '数据库名或者IP,本机填“(local)”即可。
connDatabase = "account" '数据库名称
connUserName = "xx" '数据库用户名
connPassword = "xxxxxx" '数据库密码
'---------------------------------------------------------------------------
Sub OpenData
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=SQLOLEDB;Data Source="&connServerName&";Initial Catalog="&connDatabase&";User ID="&connUserName&";Password="&connPassword&";"
conn.Open connstr
END Sub copyright dedecms
Sub CloseData
Conn.close
Set conn = Nothing
End Sub copyright dedecms
dim conn2,connstr2,connServerName2,connDatabase2,connUserName2,connPassword2
'修改以下信息以适合你的
'---------------------------------------------------------------------------
connServerName2 = "(local)" '数据库名或者IP,本机填“(local)”即可。
connDatabase2 = "chart" '数据库名称
connUserName2 = "xx" '数据库用户名
connPassword2 = "xxxxxx" '数据库密码
'---------------------------------------------------------------------------
Sub OpenData2
Set conn2 = Server.CreateObject("ADODB.Connection")
connstr2="Provider=SQLOLEDB;Data Source="&connServerName1&";Initial Catalog="&connDatabase1&";User ID="&connUserName1&";Password="&connPassword1&";"
conn2.Open connstr2
END Sub
Sub CloseData2
Conn2.close
Set conn2 = Nothing
End Sub
织梦内容管理系统
dedecms.com
ps_loginname=left(replace(request.form("username"),"'","’"),14)
ps_loginpass=left(replace(request.form("userpass"),"'","’"),14)
ps_juesename=left(replace(request.form("juesename"),"'","’"),14)
ps_wpcode=left(replace(request.form("wpcode"),"'","’"),14)
function checkstr(str)
checkstr = 0
IF str="" or isNull(str) then
checkstr = 1
exit function
end if 织梦内容管理系统
Dim TempChar,TempURL
TempURL = Len(str)
For Loop_N = 1 to TempURL
TempChar = ASC(Mid(str,Loop_N,1))
If TempChar < 0 Then TempChar = TempChar + 65535
If TempChar < 45 or (TempChar>45 and TempChar<48) or (TempChar>57 and TempChar<65) or (TempChar>90 and TempChar < 95) or TempChar = 96 or (TempChar > 122 and TempChar < 33088) Then
checkstr = 1
Exit Function
End If
Next
end function 本文来自织梦
if checkstr(ps_loginname)=1 then
response.write "<script language=javascript>alert('只能输入字母数字下划线');history.back();</script>"
response.end
end if 织梦内容管理系统
if ps_loginname="" or ps_loginpass="" or ps_juesename="" then
response.write "<script language=javascript>alert('输入错误');history.back();</script>"
response.end
end if
if not IsNumeric(ps_wpcode) or ps_wpcode="" or isnull(ps_wpcode) then
response.write "<script language=javascript>alert('物品代码错误');history.back();</script>"
response.end
end if dedecms.com
织梦好,好织梦
dim flagstr,ct_userid
ct_userid=0
flagstr=0 织梦好,好织梦
OpenData
sql="select ut_userid,ut_password from [USERTABLE] where ut_userid='"&ps_loginname&"' and ut_password='"&ps_loginpass&"'"
set rs=conn.execute(sql)
if rs.eof and rs.bof then
flagstr=0
else
flagstr=3
end if
rs.close
set rs=nothing
CloseData 织梦内容管理系统
if flagstr=3 then
opendata3
sql="select * from CHARTABLE where CT_NAME='"&ps_juesename&"' and CT_USERID = '"&ps_loginname&"'"
set rs=conn3.execute(sql)
if rs.eof or rs.bof then
flagstr=1
else
ct_userid=rs("ct_seq")
flagstr=4
end if
rs.close
set rs=nothing
if flagstr=4 then
sql="delete from inventorytable where it_useridx="&ct_userid&" and it_itemidx="&ps_wpcode
conn3.execute(sql)
flagstr=5
end if
closedata3
end if copyright dedecms
if flagstr=1 then
response.write "<script language=javascript>alert('您的角色名称不正确!');history.back();</script>"
end if
if flagstr=2 then
response.write "<script language=javascript>alert('您的帐号密码不正确!');history.back();</script>"
end if
if flagstr=5 then
response.write "<script language=javascript>alert('清除成功!');history.back();</script>"
end if
%> dedecms.com