在主页面进行include页面变的非常混乱

feike0o 2003-03-15 10:22:31
如果把代码放到主页面上,也是可以显示,但是非常混乱
请问怎么办?

include 文件内容

<table width="100%" border="0">
<%
set conn=server.createobject("ADODB.CONNECTION")
conn.open "DBQ="+server.mappath("vote/poll.mdb")+";DRIVER={Microsoft Access Driver (*.mdb)};"
set rs=server.createobject("adodb.recordset")
set rs_title=server.createobject("adodb.recordset")
sql="SELECT sum(pitemnum) from items where pid=(select max(id) from descrip)"
sql_title="select * from descrip where id=(select max(id) from descrip)"
set TOTAL=conn.execute(sql)
TOTAL=TOTAL(0)
sql="SELECT * from items where pid=(select max(id) from descrip) order by pitem asc"
rs.open sql,conn,1,1
rs_title.open sql_title,conn,1,1
%>
<FORM name=form1 ACTION=vote/indexpoll.asp method=post target="_blank>
<table width="100%" border="0">
<tr>
<td><font color=red><%=rs_title("title")%></font></td>
</tr>
<table border=1 borderColorDark=#ffffec borderColorLight=#5e5e00 cellPadding=1 cellSpacing=0 width=26%>
<%
cc=1
while not rs.eof
if cc mod 2=1 then
Response.Write "<tr bgcolor=#E7E7E7>"
else
Response.Write "<tr BGCOLOR=#F4F4F4>"
end if
%>

<td align="center" width="10%">
<%if rs_title("flag")="单选" then%>
<input type="radio" value=<%=rs("pitem")%> name="pitem"><%else%>
<input type="checkbox" name="pitem" value=<%=rs("pitem")%>><%end if%>
</td>
<td align="center" width="90%"><%=rs("pitemtext")%></td>

<%
cc=cc+1
rs.movenext
wend
rs.close
set rs=nothing
rs_title.close
conn.close
set conn=nothing
%>
</table><p align=left>
<INPUT TYPE="submit" NAME="submit" VALUE="投 票" size=2>
<a href="vote/pollvalue.asp?pid=(select max(id) from descrip)" target="_blank">查看结果</a>
<a href="vote/pollall.asp" target="_blank">更多</a>
</FORM>
</table>
...全文
23 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
mmhh516 2003-03-15
  • 打赏
  • 举报
回复
头通中。。。。。。。。。。。。。。
是该看看HTML啊,对写代码有好处!
Andyken 2003-03-15
  • 打赏
  • 举报
回复
<table> and </table>
<tr> and </tr>
<td> and </td>
都是成对出现的。不然的话表格就会乱套了,你有时间学学html.
pangpangxu 2003-03-15
  • 打赏
  • 举报
回复
不太明白!如何混乱?
Andyken 2003-03-15
  • 打赏
  • 举报
回复
<table width="100%" border="0">
<%
set conn=server.createobject("ADODB.CONNECTION")
conn.open "DBQ="+server.mappath("vote/poll.mdb")+";DRIVER={Microsoft Access Driver (*.mdb)};"
set rs=server.createobject("adodb.recordset")
set rs_title=server.createobject("adodb.recordset")
sql="SELECT sum(pitemnum) from items where pid=(select max(id) from descrip)"
sql_title="select * from descrip where id=(select max(id) from descrip)"
set TOTAL=conn.execute(sql)
TOTAL=TOTAL(0)
sql="SELECT * from items where pid=(select max(id) from descrip) order by pitem asc"
rs.open sql,conn,1,1
rs_title.open sql_title,conn,1,1
%>
<FORM name=form1 ACTION=vote/indexpoll.asp method=post target="_blank>
<table width="100%" border="0">
<tr>
<td><font color=red><%=rs_title("title")%></font></td>
</tr>
'''''''''''''''''这里加"</table>"
<table border=1 borderColorDark=#ffffec borderColorLight=#5e5e00 cellPadding=1 cellSpacing=0 width=26%>
<%
cc=1
while not rs.eof
if cc mod 2=1 then
Response.Write "<tr bgcolor=#E7E7E7>"
else
Response.Write "<tr BGCOLOR=#F4F4F4>"
end if
%>

<td align="center" width="10%">
<%if rs_title("flag")="单选" then%>
<input type="radio" value=<%=rs("pitem")%> name="pitem"><%else%>
<input type="checkbox" name="pitem" value=<%=rs("pitem")%>><%end if%>
</td>
<td align="center" width="90%"><%=rs("pitemtext")%></td>

<%
cc=cc+1
rs.movenext
wend
rs.close
set rs=nothing
rs_title.close
conn.close
set conn=nothing
%>
'''''''''''''''''''''''''''''''''这里加"</tr>"
</table><p align=left>
<INPUT TYPE="submit" NAME="submit" VALUE="投 票" size=2>
<a href="vote/pollvalue.asp?pid=(select max(id) from descrip)" target="_blank">查看结果</a>
<a href="vote/pollall.asp" target="_blank">更多</a>
</FORM>
</table>

28,391

社区成员

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

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