| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 525 人关注过本帖
标题:这个留言本的首页代码那里出错了。。谢谢
只看楼主 加入收藏
幸福
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2007-4-19
收藏
 问题点数:0 回复次数:1 
这个留言本的首页代码那里出错了。。谢谢

<%@LANGUAGE="VBScript" codepage="936"%>
<!--#include file="conn.asp"-->
<%
set rs=server.createobject("adodb.recordset")
sql="select user,qq,email,content,data from main order by id desc"
rs.open sql,conn,1,1
%>

<html>
<head>
<title>留言本-首页</title>
<link href="style.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
<body>
<table width="450" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><TABLE id=Table40 cellSpacing=1 cellPadding=3 width=450
bgColor=#c6d7c6 border=0>
<TBODY>
<TR>
<TD colspan="2" bgColor=#f5faf5><TABLE cellSpacing=0 cellPadding=0 width="100%"
border=0>
<TBODY>
<TR>
<TD width="88%"><P style="MARGIN-TOP: 3px; MARGIN-LEFT: 10px"><span class="text1" style="font-weight: bold"><%=rs("user")%></span>&nbsp;留言于&nbsp;<%=rs("data")%></P></TD>
<TD width="12%" align=right><a href="http://search.tencent.com/cgi-bin/friend/user_show_info?ln=<%=rs("qq")%>" target="_blank">QQ</a>&nbsp;&nbsp;<a href="mailto:<%=rs("email")%>">邮件</a></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
<TR>
<TD width=50 bgColor=white><P class="text2" style="MARGIN-TOP: 3px; MARGIN-LEFT: 10px">内容:</p></TD>
<TD width=385 bgColor=white><P style="MARGIN-TOP: 3px; MARGIN-LEFT: 10px"><%=rs("content")%></p></TD>
</TR>
</TBODY>
</TABLE></td>
</tr>
<tr>
<td height="20"></td>
</tr>
</table>
<%
rs.movenext
loop
%>
<table width="450" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="330" align="center"></td>
<td align="center"><a href="add.asp">填写留言</a></td>
<td align="center"><a href="admin.asp">管理留言</a></td>
</tr>
</table>
</body>
</html>

最好是把代码复制到DW里看看。。在这里不行。。。
搜索更多相关主题的帖子: 留言本 首页 代码 VBScript 
2007-04-25 17:43
lq7350684
Rank: 6Rank: 6
等 级:贵宾
威 望:20
帖 子:5089
专家分:98
注 册:2006-11-6
收藏
得分:0 
<%@LANGUAGE="VBScript" codepage="936"%>
<!--#include file="conn.asp"-->
<%set rs=server.createobject("adodb.recordset")
sql="select user,qq,email,content,data from main order by id desc"
rs.open sql,conn,1,1
if rs.eof then
response.Write "无此信息!"
else
%>
<html>
<head>
<title>留言本-首页</title>
<link href="style.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<%do while not rs.eof%>
<table width="450" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<TABLE id=Table40 cellSpacing=1 cellPadding=3 width=450 bgColor=#c6d7c6 border=0>
<TBODY>
<TR>
<TD colspan="2" bgColor=#f5faf5>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD width="88%"><P style="MARGIN-TOP: 3px; MARGIN-LEFT: 10px"><span class="text1" style="font-weight: bold"><%=rs("user")%></span>&nbsp;留言于&nbsp;<%=rs("data")%></P></TD>
<TD width="12%" align=right><a href="http://search.tencent.com/cgi-bin/friend/user_show_info?ln=<%=rs("qq")%>" target="_blank">QQ</a>&nbsp;&nbsp;<a href="mailto:<%=rs("email")%>">邮件</a></TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
<TR>
<TD width=50 bgColor=white><P class="text2" style="MARGIN-TOP: 3px; MARGIN-LEFT: 10px">内容:</p></TD>
<TD width=385 bgColor=white><P style="MARGIN-TOP: 3px; MARGIN-LEFT: 10px"><%=rs("content")%></p></TD>
</TR>
</TBODY>
</TABLE>
</td>
</tr>
<tr>
<td height="20"></td>
</tr>
</table>
<%rs.movenext
loop
end if
rs.close
set rs=nothing
%>
<table width="450" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="330" align="center"></td>
<td align="center"><a href="add.asp">填写留言</a></td>
<td align="center"><a href="admin.asp">管理留言</a></td>
</tr>
</table>
</body>
</html>






少了一个循环.
2007-04-26 09:29
快速回复:这个留言本的首页代码那里出错了。。谢谢
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017460 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved