28,409
社区成员




1,this.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<form name="myForm" action="untitled.asp?goods_id=1" method="post">
<input type="text" name="text1" value="" />
<input type="Submit" name="submit" value="确定">
</form>
</body>
</html>
2.untitled.asp
<style type="text/css">
<!--
TD {
FONT-SIZE: 12px;
}
-->
</style>
<%
dim conn,strcon
strcon="Provider=Sqloledb;User ID=sa;Password=sa;Initial Catalog =test;Data Source=(local);"
Set conn = Server.CreateObject("ADODB.Connection")
conn.open strcon
%>
<title>物品认领 </title>
</head>
<body>
<%
dim goods,goods_id,rs,sql,user,cs_err
goods_id=trim(request.QueryString("goods_id"))
response.write goods_id
set rs=Server.CreateObject("adodb.recordset")
sql="Select 用户名 from 物品表 where ID="&goods_id
response.write sql
rs.Open sql,conn,1,1
if rs.eof and rs.bof then
response.write sql
response.end
rs.close
set rs=nothing
conn.close
set conn=nothing
set hx=nothing
response.Write(" <table width='100%' border='1' cellpadding='0' cellspacing='0' bordercolor='#cccccc'> <tr> <td height='50' bgcolor='#FBF9EA' align='center'> 请不要进行本店外操作!!! </td> </tr> </table>")
response.End()
end if
user=trim(rs("用户名"))
response.write "ddfdf"
rs.close
set rs=nothing
if trim(request.Form("hiddenField")) ="ture" then
cs_err=""
dim cs_user,cs_pwd1,cs_pwd2,phone,cs_code
cs_user=trim(request.Form("user"))
'if cs_user="" or isnull(cs_user) or isempty(user) then
' cs_err="请输入用户名"
' end if
' if len(cs_user)>20 or len(cs_user) <6 then
' cs_err="用户名为6~20字符"
' end if
' cs_pwd1=trim(request.Form("pwd1"))
' if cs_pwd1="" or isnull(cs_pwd1) or isempty(cs_pwd1) then
' cs_err="请输入密码"
' end if
' if len(cs_pwd1)>18 or len(cs_pwd1) <6 then
' cs_err="密码为6~18字符"
' end if
' cs_pwd2=trim(request.Form("pwd2"))
' if cs_pwd2="" or isnull(cs_pwd2) or isempty(cs_pwd2) then
' cs_err="请输入密码"
' end if
' if cs_pwd1 <>cs_pwd2 then
' cs_err="密码和确认密码不相符"
' end if
' if cs_err <>"" then
' conn.close
' set conn=nothing
' set hx=nothing
'response.End()
'end if
response.write "234"
set rs=Server.CreateObject("adodb.recordset")
sql="Select * from 物品表 where 用户名='"&cs_user&"'"
response.write sql
rs.Open sql,conn,3,1
dim uq
if rs.eof and rs.bof then
uq=0
else
uq=1
end if
response.write uq
rs.close
set rs=nothing
if uq=0 then
dim srs,ussql
set srs=Server.CreateObject("adodb.recordset")
ssql="Select 用户名,密码 from 物品表 where ID="&goods_id
response.write ssql
response.write ssql
srs.open ssql,conn,1,3
srs("用户名")=cs_user
srs("密码")=cs_pwd1
srs.update
response.write "更新"
response.end
srs.close
set srs=nothing
conn.close
set conn=nothing
set hx=nothing
response.Write(" <script>alert('物品申请成功,本站将在12小时内审核。现在将返回首页。');window.location.href='index.asp'; </script>")
response.End()
else
conn.close
set conn=nothing
set hx=nothing
response.Write(" <script LANGUAGE='javascript'>alert('用户名已存在');history.go(-1); </script>")
response.End()
end if
end if
if user="" or isnull(user) or isempty(user) then
%>
<form id="form1" name="form1" method="post" action="untitled.asp?goods_id=<%=goods_id%>">
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#cccccc">
<tr>
<td height="33" colspan="3" align="center" background="images/h2dhbg.jpg"> - <%=goods%>-物品认领 </td>
</tr>
<tr>
<td height="10" colspan="3" align="right" bgcolor="#FBF9EA"> </td>
</tr>
<tr>
<td width="20%" height="40" align="right" bgcolor="#FBF9EA">用户名: </td>
<td height="40" colspan="2" bgcolor="#FBF9EA"> <label>
<input name="user" type="text" id="user" />
</label> <font color="#ff0000">(*必须为数字、字母、下划线组成) </font> </td>
</tr>
<tr>
<td width="20%" height="40" align="right" bgcolor="#FBF9EA">密码: </td>
<td height="40" colspan="2" bgcolor="#FBF9EA"> <label>
<input name="pwd1" type="password" id="pwd1" size="16" />
</label> <font color="#ff0000">(*必须为数字、字母组成) </font> </td>
</tr>
<tr>
<td width="20%" height="40" align="right" bgcolor="#FBF9EA">确认密码: </td>
<td height="40" colspan="2" bgcolor="#FBF9EA"> <label>
<input name="pwd2" type="password" id="pwd2" size="16" />
</label> <font color="#ff0000">(*) </font> </td>
</tr>
<tr>
<td width="20%" height="40" align="right" bgcolor="#FBF9EA">联系电话: </td>
<td height="40" colspan="2" bgcolor="#FBF9EA"> <label>
<input name="telph" type="text" id="telph" />
</label> <font color="#ff0000">(*) </font> </td>
</tr>
<tr>
<td height="40" colspan="3" align="center" bgcolor="#FBF9EA"> <label>
<input type="hidden" name="hiddenField" value="ture"/>
<input type="submit" name="Submit" value="提 交" />
</label> </td>
</tr>
</table>
</form>
<%
else
conn.close
set conn=nothing
set hx=nothing
response.Write(" <tr> <td align='center'bgcolor='#FBF9EA' height='50'> <b>您申请的物品已被认领,如有疑问,请联系本站,我们将进行查证。 </b> </td> </tr> </table>")
end if
%>
</body>
</html>