?? usermodify.asp
字號:
<%if session("password")<>"" then%>
<!-- #include file="inc/top.asp" -->
<!-- #include file="inc/adminmenu.asp" -->
<!--#INCLUDE FILE="inc/conn.asp"-->
<style type="text/css">
body {
background-image: url(2/main.jpg);
background-attachment:fixed|scroll;
}
</style>
<%a=request("action")
if a="modify" then
id=request("id")
if id="" or not isNumeric(id) then
response.Write("<script>alert('參數錯誤');history.back();</script>")
end if
page=request("page")
bj=request("bj")
xh=request("xh")
xm=request("xm")
sex=request("sex")
add=request("add")
yb=request("yb")
conn.execute("update user set bj='"&bj&"',xh='"&xh&"',xm='"&xm&"',sex='"&sex&"',addr='"&add&"',yb='"&yb&"' where id="&id&"")
response.Write("<script>alert('修改成功');location.replace('admin_xhs.asp?page="&page&"');</script>")
end if%>
<table width="768" height="25" align="center" cellpadding="0" cellspacing="0" class="unnamed_rld2">
<%'if request.querystring("kind")="user" then
page=request("page")
id=request("id")
if id="" or not isNUmeric(id) then
response.Write("<script>alert('參數錯誤');history.back();</script>")
end if
set r=conn.execute("select * from user where id="&id&"")
if not (r.eof and r.bof ) then
%>
<tr>
<td align="center"><form name="form1" method="post" action="?action=modify&id=<%=id%>&page=<%=page%>">
<br>
<table width="50%" border="1" cellspacing="0" cellpadding="0" bordercolor="#eeeeee">
<tr align="center">
<td colspan="2">學生信息修改</td>
</tr>
<tr>
<td width="27%" align="center"> [ <span style="color: #FF0000">班級</span> ]</td>
<td width="73%"><select name="bj" id="xh">
<option>--==請選擇==--</option>
<%
set rs=server.createobject("adodb.recordset")
conn = "DBQ=" + server.mappath("sp_class.mdb") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
sql="select * from bjb"
rs.Open sql,conn,1,1
do while not rs.eof
%>
<option <%if rs("bj")=r("bj")then response.Write("selected")%> value="<%=rs("bj")%>"><%=rs("bj")%></option>
<%
rs.movenext
loop
rs.Close
set rs=nothing
'set conn=nothing
%></select></td>
</tr>
<tr>
<td align="center"> [ <span style="color: #FF0000">學號</span> ] </td>
<td><input name="xh" type="text" size="30" value="<%=r("xh")%>"></td>
</tr>
<tr>
<td align="center"> 姓名 </td>
<td><input name="user" type="text" size="30" value="<%=r("xm")%>"></td>
</tr>
<tr>
<td align="center"> 性別 </td>
<td><select name="sex">
<option <%if r("sex")="男" then response.Write("selected")%> value="男">男</option><option<% if r("sex")="女" then response.Write("selected")%> value="女">女</option></select></td>
</tr>
<tr>
<td align="center"> 住址 </td>
<td><input name="addr" type="text" size="30" value="<%=r("addr")%>"></td>
</tr>
<tr>
<td align="center"> 郵編 </td>
<td><input name="yb" type="text" size="30" value="<%=r("yb")%>"></td>
</tr>
<tr align="center">
<td colspan="2">
<input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit2" value="清除"></td>
</tr>
<tr>
<td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="13%" align="center"> </td>
<td width="87%"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table></td>
</tr>
</table>
</form>
</td>
</tr>
<%
end if
r.close
set r=nothing
'end if%>
</table>
<!-- #include file="inc/copyright.asp" -->
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -