28,391
社区成员
发帖
与我相关
我的任务
分享
<!-- #include file="add.asp" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
-->
</style></head>
<body>
<%
on error resume next
if request.QueryString("act")="xiugai" then
id=request("id")
conn.begintrans
set rst=server.CreateObject("ADODB.recordset")
sql="select * from users where u_id="&id
rst.open sql,conn,1,3
rst("u_user")=request.form("f_user")
rst("u_code")=request.form("f_code")
rst("u_name")=request.form("f_name")
rst("u_sex")=request.form("f_sex")
rst("u_age")=request.form("f_age")
rst.update
if err.number<>0 then
conn.rollbacktrans
response.Write "修改会员失败!"
response.write err.description
else
conn.committrans
response.Write "修改会员成功!"
end if
else
%>
<table width="800" height="747" border="0" align="center" cellpadding="0" cellspacing="0" background="img/hyzlxg.jpg">
<tr>
<td height="443" align="center" valign="middle">
<%
set rst=server.CreateObject("adodb.recordset")
rst.open "select * from users where u_id="&request.QueryString("id"),conn,1,1
%>
<form method="post" action="xiugai.asp?act=xiugai&id=<%=request("id")%>">
<table width="691" height="330" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" align="center"><a href="guanli.asp">返回会员列表</a></td>
</tr>
<tr>
<td colspan="2" align="center">请在下面修改会员资料!</td>
</tr>
<tr>
<td width="296" align="right">用户名:</td>
<td width="395" align="left"><input type="text" size=20 name="f_user" value="<%=rst("u_user")%>"></td>
</tr>
<tr>
<td align="right">密 码:</td>
<td align="left"><input type="text" size=20 name="f_code" value="<%=rst("u_code")%>"></td>
</tr>
<tr>
<td align="right">姓 名:</td>
<td align="left"><input type="text" size=20 name="f_name" value=<%=rst("u_name")%>></td>
</tr>
<tr>
<td align="right">性 别:</td>
<td align="left"><select name="f_sex" id="f_sex" value="<%=rst("f_sex")%>">
<option value="男" selected="selected">男</option>
<option value="女"<% if rst("u_sex")="女" then response.write "selected"%>>女
</select> </td>
</tr>
<tr>
<td align="right">年 龄:</td>
<td align="left"><input type="text" name="f_age" size=10 value="<%=rst("u_age")%>"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="修改会员资料"> <input type="reset" value="重置表单" name="reset"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<%
rst.close
Set rst=Nothing
End If
%>
</body>
</html>
<%
on error resume next
if request.QueryString("act")="xiugai" then
id=request.querystring("id")
conn.begintrans
set rst=server.CreateObject("ADODB.recordset")
sql="update users where u_id="&id
rst.open sql,conn,1,3
rst("u_user")=request.form("f_user")
rst("u_code")=request.form("f_code")
rst("u_name")=request.form("f_name")
rst("u_sex")=request.form("f_sex")
rst("u_age")=request.form("f_age")
rst.update
if err.number<>0 then
conn.rollbacktrans
response.Write "修改会员失败!"
response.write err.description
else
conn.committrans
response.Write "修改会员成功!"
end if
rst.close
Set rst=nothing
else
%>
<table width="800" height="747" border="0" align="center" cellpadding="0" cellspacing="0" background="img/hyzlxg.jpg">
<tr>
<td height="443" align="center" valign="middle">
<%
set rst=server.CreateObject("adodb.recordset")
rst.open "select * from users where u_id="&request.QueryString("id"),conn,1,1%>
<form method="post" action="xiugai.asp?act=xiugai&id=<%=request.querystring("u_id")%>">
<table width="691" height="330" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" align="center"><a href="guanli.asp">返回会员列表</a></td>
</tr>
<tr>
<td colspan="2" align="center">请在下面修改会员资料!</td>
</tr>
<tr>
<td width="296" align="right">用户名:</td>
<td width="395" align="left"><input type="text" size=20 name="f_user" value="<%=rst("u_user")%>"></td>
</tr>
<tr>
<td align="right">密 码:</td>
<td align="left"><input type="text" size=20 name="f_code" value="<%=rst("u_code")%>"></td>
</tr>
<tr>
<td align="right">姓 名:</td>
<td align="left"><input type="text" size=20 name="f_name" value=<%=rst("u_name")%>></td>
</tr>
<tr>
<td align="right">性 别:</td>
<td align="left"><select name="f_sex" id="f_sex" value="<%=rst("f_sex")%>">
<option value="男" selected="selected">男</option>
<option value="女"<% if rst("u_sex")="女" then response.write "selected"%>>女
</select> </td>
</tr>
<tr>
<td align="right">年 龄:</td>
<td align="left"><input type="text" name="f_age" size=10 value="<%=rst("u_age")%>"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="修改会员资料"> <input type="reset" value="重置表单" name="reset"></td>
</tr>
</table>
</form>
<%
rst.close
Set rst=Nothing
End If
%>