ASP中如何让网站标题与文章标题一致?

代码如下:<%Ifrequest.QueryString("ID")=""OrNotIsNumeric(request.QueryString("ID"))Thenres... 代码如下:

<%
If request.QueryString("ID") = "" Or Not IsNumeric(request.QueryString("ID")) Then
response.Write "<script language=javascript>alert('非法操作');window.history.back();</script>"
response.End
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=site("site_name")%>-<%=site("site_keywords")%></title>
<meta name="keywords" content="<%=site("site_keywords")%>" />
<meta name="description" content="<%=site("site_description")%>" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!--#include file="header.asp"-->
<div id="Central" class="layoutt">
<!--#include file="left.asp"-->
<div id="right">
<div class="right_title">
<%
id = request("id")
Set rs = Server.CreateObject("ADODB.RecordSet")
sql = "select * from news where id="&id
rs.Open sql, conn, 1, 3
If rs.EOF And rs.bof Then
Response.Write "<script language='javascript'>alert('无效参数值!');document.location.href('news.asp');</script>"
Else
%>
<h2>新闻详情</h2>
</div>
<div class="right_body">
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="28"><h3><%=rs("title")%></h3></td>
</tr>
<tr>
<td style="border:1px dashed #CCC; border-top:none; border-left:none; border-right:none; margin-top:5px; padding-right:5px;" align="right">发布者:<%=rs("author")%> 日期:<%=left(rs("data"),10)%> 点击次:<font color='#ff0000'><%=rs("hits")%></font></td>
</tr>
<tr>
<td height="10"></td>
</tr>
<tr>
<td><%=rs("body")%></td>
</tr>
</table>
<%
rs("hits") = rs("hits") + 1
rs.update
End If
rs.Close
Set rs = Nothing
%>

</div>
</div>
<div class="clear"></div>
<div id="link_text">
<ul>
<%
Set rs = server.CreateObject("adodb.recordset")
sql = "select top 10 * from link_text"
rs.Open sql, conn, 1, 1
Do While Not rs.EOF
%>
<li><a href="<%=rs("url")%>" title="<%=rs("title")%>"><%=rs("title")%></a></li>
<%
rs.movenext
Loop
rs.Close
Set rs = Nothing
%>
</ul>
</div>
</div>
</div>
<!--#include file="footer.asp"-->
</div>
展开
 我来答
缓步莫迟疑C
推荐于2016-09-09 · TA获得超过1.1万个赞
知道大有可为答主
回答量:6217
采纳率:73%
帮助的人:6486万
展开全部
<%
If request.QueryString("ID") = "" Or Not IsNumeric(request.QueryString("ID")) Then
response.Write "<script language=javascript>alert('非法操作');window.history.back();</script>"
response.End
End If

Dim tErr, tTitle, tAuthor, tDate, tHits, tBody
tErr = ""
id = request("id")
Set rs = Server.CreateObject("ADODB.RecordSet")
sql = "select * from news where id="&id
rs.Open sql, conn, 1, 3
If rs.EOF And rs.bof Then
tErr = "<script language='javascript'>alert('无效参数值!');document.location.href('news.asp');</script>"
Else
tTitle = rs("title")
tAuthor = rs("author")
tDate = rs("data")
tHits = rs("hits")
tBody = rs("body")
rs("hits") = rs("hits") + 1
rs.update
End If
rs.Close
Set rs = Nothing
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=tTitle%>-<%=site("site_name")%>-<%=site("site_keywords")%></title>
<meta name="keywords" content="<%=site("site_keywords")%>" />
<meta name="description" content="<%=site("site_description")%>" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!--#include file="header.asp"-->
<div id="Central" class="layoutt">
<!--#include file="left.asp"-->
<div id="right">
<div class="right_title">
<%If tErr<>"" Then%><%=tErr%><%End If%>
<h2>新闻详情</h2>
</div>
<div class="right_body">
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="28"><h3><%=tTitle%></h3></td>
</tr>
<tr>
<td style="border:1px dashed #CCC; border-top:none; border-left:none; border-right:none; margin-top:5px; padding-right:5px;" align="right">发布者:<%=tAuthor%> 日期:<%=left(tDate,10)%> 点击次:<font color='#ff0000'><%=tHits%></font></td>
</tr>
<tr>
<td height="10"></td>
</tr>
<tr>
<td><%=tBody%></td>
</tr>
</table>
</div>
</div>
<div class="clear"></div>
<div id="link_text">
<ul>
<%
Set rs = server.CreateObject("adodb.recordset")
sql = "select top 10 * from link_text"
rs.Open sql, conn, 1, 1
Do While Not rs.EOF
%>
<li><a href="<%=rs("url")%>" title="<%=rs("title")%>"><%=rs("title")%></a></li>
<%
rs.movenext
Loop
rs.Close
Set rs = Nothing
%>
</ul>
</div>
</div>
</div>
<!--#include file="footer.asp"-->
</div>
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
锁金生坚亥
2019-12-28 · TA获得超过3.7万个赞
知道大有可为答主
回答量:1.2万
采纳率:34%
帮助的人:1135万
展开全部
把页面的<tetle>标签内的内容做成动态的啊,比如:<tetle><%=rs("M_Tetle")%></tetle>
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式