这个myself是什么含义?

bbzy 2008-11-27 02:39:15
我 从网上下载了灵通在线考试系统,想学习一下,其中的一个程序,看到myself没有定义,直接使用了?不知是哪里来的?谁帮我解释一下??
<!--#include file="conn.asp"-->
<%
if session("username")="" then
response.redirect "relogin.asp"
end if

%>
<%
username=request.cookies("username")
kcid=request("kcid")
chapter=request("chapter")
category=request("category")


sql="SELECT tbtk.tmid, tbtk.title,tbtk.category, tbkc.kcid, tbkc.kcm, tbtk.chapter,tbtk.level,photo FROM tbkc, userdata, tbtk WHERE username='"&username&"' and userdata.tmid=tbtk.tmid and tbtk.kcid=tbkc.kcid and tbkc.kcid="&kcid&" and chapter="&chapter&" and kao=0 and category=3;"

set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
on error resume next


%>

<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>模拟练习 | <%=rs("kcm")%> | 第<%=rs("chapter")%>章 | 判断题</title>
<link rel="stylesheet" type="text/css" href="css.css">
</head>

<body>
<%



%><center>
<table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2" height="25">
<tr>
<td width="100%" height="30" style="border-left-style: solid; border-left-width: 0; border-right-style: solid; border-right-width: 0; border-top-style: solid; border-top-width: 0; border-bottom: 1px solid #000000">
<img border="0" src="images/kslx.gif"></td>
</tr>
<tr>
<td width="100%">当前位置:练习阶段 > <a href="selectchapter.asp?kcid=<%=rs("kcid")%>"><%=rs("kcm")%></a> > <a href="selecttype.asp?kcid=<%=rs("kcid")%>&chapter=<%=rs("chapter")%>">第<%=rs("chapter")%>章
</td>
</tr>
</table></center>
<center>
<% if Request.ServerVariables("http_method")="POST" then

response.write "<font color=red>本页答案已经提交,如要修改,请再次提交!</font>"
end if

%><form name="viewdatabase" ACTION="<%=Myself%>" method="post">
<table border="1" cellspacing="1" style="border-collapse: collapse" bordercolor="#799AE1" width="100%" id="AutoNumber1" height="165">
<tr class="trh">
<td width="48" align="center" bgcolor="#799AE1" height="21">
<font color="#FFFFFF"><b>序号</b></font></td>
<td align="center" bgcolor="#799AE1" width="588" height="21">
<p align="center"><font color="#FFFFFF"><b>判断题(共<%
sql_count="SELECT tbtk.tmid FROM tbkc,userdata,tbtk where username='"&username&"' and userdata.tmid=tbtk.tmid and tbtk.kcid=tbkc.kcid and tbkc.kcid="&kcid&" and chapter="&chapter&" and category=3 and kao=0"
set rs_count=server.createobject("adodb.recordset")
rs_count.open sql_count,conn,3,2

response.write rs_count.RecordCount
%>题)</b></font></td>
</tr>
<%



rs.PageSize =5

Page = CLng(Request("Page"))

If Page < 1 Then Page = 1
If Page > rs.PageCount Then Page = rs.PageCount
i=page+(page-1)*4
rs.AbsolutePage = Page
For iPage = 1 To rs.PageSize

text1="text"&rs("tmid")

if Request.ServerVariables("http_method")="POST" then
sql2="SELECT * FROM userdata where username='"&username&"' and tmid="&rs("tmid")
set rs2=server.createobject("adodb.recordset")
rs2.open sql2,conn,3,2


text2=request(""&text1&"")

rs2("uans")=text2
rs2.update

end if


sql3="SELECT * FROM userdata where username='"&username&"' and tmid="&rs("tmid")
set rs3=server.createobject("adodb.recordset")
rs3.open sql3,conn,3,2

%>
<tr class="trh1">
<td align="center" height="35" width="48"><%=i%> </td>
<td align="left" width="588" height="35"><br>    <%=htmlencode(rs("title"))%>——(难度:<%
if rs("level")=1 then
response.write "容易"
end if
if rs("level")=2 then
response.write "中等"
end if

if rs("level")=3 then
response.write "较难"
end if
if rs("level")=4 then
response.write "最难"
end if
%>)<br><% if len(rs("photo")) > 1 then
%> <center>
<img border="0" src="examimage/<%=rs("photo")%>"></center>
<br><% end if %>
答:
 <input type="radio" value="Y" <%if rs3("uans")="Y" then%>checked <%end if %> name="<%=text1%>" onblur="this.className='radio'" onfocus="this.className='inputedit';this.select()" class="radio">正确     
<input type="radio" value="N" <%if rs3("uans")="N" then%>checked <%end if %> name="<%=text1%>" onblur="this.className='radio'" onfocus="this.className='inputedit';this.select()" class="radio">错误

<br><br></td>
</tr>
<%
rs.MoveNext
If rs.EOF Then Exit For
i=i+1
Next
%>
<tr>
<td align="center" bgcolor="#FFFFFF" height="32" width="640" colspan="2" bordercolor="#FFFFFF">
<input class="s02" onclick="window.location='cx_test_pd.asp?kcid=<%=rs1("kcid")%>&chapter=<%=rs1("chapter")%>&category=<%=rs1("category")%>'" type="submit" value="提交" name="B1" style="float: middle"><span lang="en-us">        
</span> <INPUT class="s02" onclick="window.location='selecttype.asp?kcid=<%=kcid%>&chapter=<%=chapter%>'" type=button value=返回 name=close></td>
</tr>
<caption></caption>
</table>
</form>
</center>
<center> <form ACTION="<%=Myself%>" METHOD="GET">
<table style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
<tr>
<td width="576">
<p ALIGN="center"><%If Page <> 1 Then ' 如果不是位于第一页%>
<a href="<%=Myself%>?Page=1&kcid=<%=kcid%>&chapter=<%=chapter%>">第一页</a>
<a HREF="<%=Myself%>?Page=<%=(Page-1)%>&kcid=<%=kcid%>&chapter=<%=chapter%>">上一页</a>
<%
End If
If Page <> rs.PageCount Then ' 如果不是位于最后一页
%> <a HREF="<%=Myself%>?Page=<%=(Page+1)%>&kcid=<%=kcid%>&chapter=<%=chapter%>">下一页</a>
<a HREF="<%=Myself%>?Page=<%=rs.PageCount%>&kcid=<%=kcid%>&chapter=<%=chapter%>">最后一页</a>
<% End If %> 
<font SIZE="2">页次:</font><font COLOR="Red" SIZE="2"><%=Page%>/<%=rs.PageCount%></font></p>
<p> </td>
</tr>
</table>
</form>
</center>

</body>

</html>
...全文
509 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
jeanun 2008-11-27
  • 打赏
  • 举报
回复
没有研究过你说的系统,但照代码看来,应该是定义Action的URL用的,没有定义的话,正好可以用当前页面处理,一举二得,方便~
wj121284 2008-11-27
  • 打赏
  • 举报
回复
指本身
fcuandy 2008-11-27
  • 打赏
  • 举报
回复
看看conn里是否有引用什么const之类的文件或语句来定义myself

这里没有定义,虽然语法不报错,但程序思路上说不过去。
NIKIA 2008-11-27
  • 打赏
  • 举报
回复
myself:未定义取值NULL,用作指代本页链接;

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧