asp试题编辑的代码,解释翻译下,谢谢

来源:百度知道 编辑:UC知道 时间:2024/06/23 20:08:00
<!--#include file="conn.asp"-->
<%

dim tihao,shiti,a,b,c,d,zhengque
tihao=session("id")
if tihao<>"" then
shiti=request.Form("timu")
zhengque=request.Form("zhengque")
kemu=request.Form("kemu")
set rs=server.createobject("adodb.recordset")
cmd="select * from jianda where id like '"&tihao&"'"
rs.open cmd,conn,1,3
rs("question")=shiti
rs("ans")=zhengque
rs("kemu")=kemu
ny=request.Form("ny")
rs("ny")=ny

rs.update
response.Write("<script>alert('试题修改成功!');window.location.href('jianda.asp')</script>")
else
response.Write("<script>alert('未选择试题!');window.location.href('jianda.asp')</script>")
end if
%>

<%

dim tihao,shiti,a,b,c,d,zhengque ‘定义变量
tihao=session("id") ’把session("id")赋给 tihao
if tihao<>"" then '判断tihao 如果TIHAO不为空。。则获取FORM的表单中的值。

shiti=request.Form("timu")
zhengque=request.Form("zhengque")
kemu=request.Form("kemu")
set rs=server.createobject("adodb.recordset") '创建记录集
cmd="select * from jianda where id like '"&tihao&"'" '定义sql语句
rs.open cmd,conn,1,3 '打开记录集
rs("question")=shiti
rs("ans")=zhengque
rs("kemu")=kemu
ny=request.Form("ny")
rs("ny")=ny

rs.update '更新记录集
response.Write("<script>alert('试题修改成功!');window.location.href('jianda.asp')</script>") '提示语
else 'TIHAO为空的话
response.Write("<script>alert('未选择试题!');window.