ASP增加新闻文章点击次数代码,怎么改啊?我是新手,请各位帮帮忙
<body><tablewidth="940"border="0"align="center"cellpadding="0"cellspacing="0"><tr><td...
<body>
<table width="940" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><!--#include file="top.asp" --></td>
</tr>
</table>
<%
ComeID = split(request("ID"),"_")
If Ubound(ComeID) < 1 Then response.Redirect("index.asp")
ClassID = ComeID(0)
ID = ComeID(1)
If ClassID = "" or ID = "" Then response.Redirect("index.asp")
If isnumeric(ClassID)<>true or isnumeric(ID)<>true Then response.Redirect("index.asp")
Set rs = server.createobject("adodb.recordset")
rs.open "select * from Newsclass where ClassID='"&ClassID&"'",conn,1,1
If rs.recordcount > 0 Then
Classname = rs("Classname")
Else
response.Redirect("index.asp")
End If
rs.close
rs.open "select * from News where ID="&ID,conn,1,1
%>
<table width="940" height="30" border="1" align="center" cellpadding="2" cellspacing="1" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" bgcolor="#62B366" >
<tr>
<td height="30" bgcolor="#FFFFFF" >当前位置:<a href="index.asp">首页</a> >> <a href="news_list.asp?ID=<%=ClassID%>"><%=Classname%></a> >> 正文</td>
</tr>
</table>
<table width="940" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="550" valign="top"><table width="100%" height="550" border="1" cellpadding="2" cellspacing="1" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" bgcolor="#62B366" >
<tr>
<td valign="top" bgcolor="#FFFFFF" ><table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td height="50" align="center"><span class="FONT16"><strong><%=rs("Title")%></strong></span></td>
</tr>
<tr>
<td height="25" align="center" bgcolor="#EEEEEE">点击数:<%=rs("new_Hit")%> 来源:网络 添加人:admin
<%'=rs("Pubname")%> 添加时间:<%=FormatDate(rs("Date"))%> </td>
</tr>
<tr>
<td height="6"></td>
</tr>
<tr>
<td><%=rs("Content")%></td>
</tr>
<tr>
<td height="6"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top"><!--#include file="news_content_bottom.asp" --></td>
</tr>
</table></td>
<td width="5"> </td>
<td width="200" valign="top" bgcolor="#EEEEEE" ><!--#include file="news_content_right.asp" --></td>
</tr>
</table>
<table width="940" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><!--#include file="bottom.asp" --></td>
</tr>
</table>
</body> 展开
<table width="940" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><!--#include file="top.asp" --></td>
</tr>
</table>
<%
ComeID = split(request("ID"),"_")
If Ubound(ComeID) < 1 Then response.Redirect("index.asp")
ClassID = ComeID(0)
ID = ComeID(1)
If ClassID = "" or ID = "" Then response.Redirect("index.asp")
If isnumeric(ClassID)<>true or isnumeric(ID)<>true Then response.Redirect("index.asp")
Set rs = server.createobject("adodb.recordset")
rs.open "select * from Newsclass where ClassID='"&ClassID&"'",conn,1,1
If rs.recordcount > 0 Then
Classname = rs("Classname")
Else
response.Redirect("index.asp")
End If
rs.close
rs.open "select * from News where ID="&ID,conn,1,1
%>
<table width="940" height="30" border="1" align="center" cellpadding="2" cellspacing="1" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" bgcolor="#62B366" >
<tr>
<td height="30" bgcolor="#FFFFFF" >当前位置:<a href="index.asp">首页</a> >> <a href="news_list.asp?ID=<%=ClassID%>"><%=Classname%></a> >> 正文</td>
</tr>
</table>
<table width="940" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="550" valign="top"><table width="100%" height="550" border="1" cellpadding="2" cellspacing="1" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" bgcolor="#62B366" >
<tr>
<td valign="top" bgcolor="#FFFFFF" ><table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td height="50" align="center"><span class="FONT16"><strong><%=rs("Title")%></strong></span></td>
</tr>
<tr>
<td height="25" align="center" bgcolor="#EEEEEE">点击数:<%=rs("new_Hit")%> 来源:网络 添加人:admin
<%'=rs("Pubname")%> 添加时间:<%=FormatDate(rs("Date"))%> </td>
</tr>
<tr>
<td height="6"></td>
</tr>
<tr>
<td><%=rs("Content")%></td>
</tr>
<tr>
<td height="6"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top"><!--#include file="news_content_bottom.asp" --></td>
</tr>
</table></td>
<td width="5"> </td>
<td width="200" valign="top" bgcolor="#EEEEEE" ><!--#include file="news_content_right.asp" --></td>
</tr>
</table>
<table width="940" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><!--#include file="bottom.asp" --></td>
</tr>
</table>
</body> 展开
2个回答
展开全部
Set rs = server.createobject("adodb.recordset")
rs.open "select * from Newsclass where ClassID='"&ClassID&"'",conn,1,1
If rs.recordcount > 0 Then
Classname = rs("Classname")
Else
response.Redirect("index.asp")
End If
rs.close
'''''''''''''''''''''''''''
'''''这里插入
conn.execute("update News set new_Hit=new_Hit+1 where ID="&ID)
''''''''''''''''''''''''''''''
rs.open "select * from News where ID="&ID,conn,1,1
晕,居然楼上快我一点点
rs.open "select * from Newsclass where ClassID='"&ClassID&"'",conn,1,1
If rs.recordcount > 0 Then
Classname = rs("Classname")
Else
response.Redirect("index.asp")
End If
rs.close
'''''''''''''''''''''''''''
'''''这里插入
conn.execute("update News set new_Hit=new_Hit+1 where ID="&ID)
''''''''''''''''''''''''''''''
rs.open "select * from News where ID="&ID,conn,1,1
晕,居然楼上快我一点点
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询