想做一个存储数据到数据库的操作,全部代码如下: <!--#include file="conn.asp"--> <script language="javascript"> function back() { location.href="index.asp"; } </script> <% if request.servervariables("content_length") <>0 then response.write"ok" end if iid=cint(request.querystring("id")) set rs=server.createobject("adodb.recordset") msql="select * from utable where id="&iid rs.open msql,conn,1,3 if rs.bof and rs.eof then response.write "此记录已删除" response.write " <input type='button' name='b3' value='返回' onclick='back();'> " response.end end if %> <html> <head> <title>修改记录 </title> </head> <body> <form method="post" action="modifydata.asp"> 姓名: <input type="text" name="name" value= <%=rs("name")%>> <br> 性别: <select name="sex"> <option value="男" <%if rs("sex")="男" then response.write "selected" end if%>>男 </option> <option value="女" <%if rs("sex")="女" then response.write "selected" end if%>>女 </option> </select> <br> <!--因为是服务器端脚本,所以向浏览器输入HTML关键字需要使用response.write方法--> 电话: <input type="text" name="tel" value= <%=rs("tel")%>> <br> Q Q : <input type="text" name="qq" value= <%=rs("qq")%>> <br> 网站: <input type="text" name="web" value= <%=rs("web")%>> <br> 邮箱: <input type="text" name="email" value= <%=rs("email")%>> <br> 备注: <input type="text" name="memo" value= <%=rs("memo")%>> <br> <input type="submit" name="b1" value="保存"> <input type="reset" name="b2" value="重改"> <input type="button" name="b3" value="返回" onclick="back();"> </form> <body> </html> |