ASP怎么调用文章标题作为网页标题?
好心人帮忙,我想调用<%=rs("P_name")%>作为网页标题,因为现在标题是写死的,写点什么代码能够调用。<!DOCTYPEhtmlPUBLIC"-//W3C//D...
好心人帮忙,我想调用<%=rs("P_name")%>作为网页标题,因为现在标题是写死的,写点什么代码能够调用。
<!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>昆山环氧地坪|昆山地坪漆|昆山环氧树脂地坪|昆山无震动止滑车道|昆山防滑车道-昆山华睿达净化科技有限公司</title>
<link href="css.css" rel="stylesheet" type="text/css" />
</HEAD>
<td height="103" valign="top" background="image/right bj.gif" style="padding-left:20px"><table width="661" border="0" cellspacing="0" cellpadding="0">
<%
Pid=Cint(request.QueryString("P_ID"))
if Pid<1 or not isnumeric(Pid) then
response.Write("请勿直接浏览此页面,请返回!")
response.End()
else
set rs=conn.execute("select P_ID,P_Name,P_Pic,P_Instr,orderId from P_product where P_ID="&Pid)
if rs.eof and rs.bof then
response.Write("非法操作,请终止!")
rs.close
conn.close
response.End()
else
'conn.execute("update P_product set Hits=Hits+1 where P_ID="&Pid)
%>
<tr>
<tr>
<td width="330" ><div align="left"><img src="<%=mid(rs("P_Pic"),4)%>" width="300" class="border" />
</div>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>产品名称:<b><%=rs("P_name")%></b></td>
</tr>
</table></td>
</tr>
<tr>
<td height="20" colspan="3" class="p12">产品说明:<%=rs("P_Instr")%></td>
</tr>
<tr>
<td height="30" colspan="3" align="right" class="p12">
<% set rss=conn.execute("select top 1 P_ID from P_product where orderId < "&rs("orderId")&" order by orderId desc,P_ID asc")
if not rss.eof and not rss.bof then%><strong>[</strong> <a href="?P_ID=<%=rss(0)%>">前一条</a><strong>]</strong>
<% end if
rss.close%>
<% set rsbb=conn.execute("select top 1 P_ID from P_product where orderId > "&rs("orderId")&" order by orderId asc,P_ID asc")
if not rsbb.eof and not rsbb.bof then%><strong>[</strong> <a href="?P_ID=<%=rsbb(0)%>">后一条</a><strong>]</strong>
<% end if
rsbb.close%>
<!--#include file="end.asp"-->
<%end if
end if%>
</body>
</html> 展开
<!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>昆山环氧地坪|昆山地坪漆|昆山环氧树脂地坪|昆山无震动止滑车道|昆山防滑车道-昆山华睿达净化科技有限公司</title>
<link href="css.css" rel="stylesheet" type="text/css" />
</HEAD>
<td height="103" valign="top" background="image/right bj.gif" style="padding-left:20px"><table width="661" border="0" cellspacing="0" cellpadding="0">
<%
Pid=Cint(request.QueryString("P_ID"))
if Pid<1 or not isnumeric(Pid) then
response.Write("请勿直接浏览此页面,请返回!")
response.End()
else
set rs=conn.execute("select P_ID,P_Name,P_Pic,P_Instr,orderId from P_product where P_ID="&Pid)
if rs.eof and rs.bof then
response.Write("非法操作,请终止!")
rs.close
conn.close
response.End()
else
'conn.execute("update P_product set Hits=Hits+1 where P_ID="&Pid)
%>
<tr>
<tr>
<td width="330" ><div align="left"><img src="<%=mid(rs("P_Pic"),4)%>" width="300" class="border" />
</div>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>产品名称:<b><%=rs("P_name")%></b></td>
</tr>
</table></td>
</tr>
<tr>
<td height="20" colspan="3" class="p12">产品说明:<%=rs("P_Instr")%></td>
</tr>
<tr>
<td height="30" colspan="3" align="right" class="p12">
<% set rss=conn.execute("select top 1 P_ID from P_product where orderId < "&rs("orderId")&" order by orderId desc,P_ID asc")
if not rss.eof and not rss.bof then%><strong>[</strong> <a href="?P_ID=<%=rss(0)%>">前一条</a><strong>]</strong>
<% end if
rss.close%>
<% set rsbb=conn.execute("select top 1 P_ID from P_product where orderId > "&rs("orderId")&" order by orderId asc,P_ID asc")
if not rsbb.eof and not rsbb.bof then%><strong>[</strong> <a href="?P_ID=<%=rsbb(0)%>">后一条</a><strong>]</strong>
<% end if
rsbb.close%>
<!--#include file="end.asp"-->
<%end if
end if%>
</body>
</html> 展开
3个回答
展开全部
<%
Pid=Cint(request.QueryString("P_ID"))
if Pid<1 or not isnumeric(Pid) then
response.Write("请勿直接浏览此页面,请返回!")
response.End()
else
set rs=conn.execute("select P_ID,P_Name,P_Pic,P_Instr,orderId from P_product where P_ID="&Pid)
if rs.eof and rs.bof then
response.Write("非法操作,请终止!")
rs.close
conn.close
response.End()
else
'conn.execute("update P_product set Hits=Hits+1 where P_ID="&Pid)
%>
<!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><%=rs(1)%></title>
<link href="css.css" rel="stylesheet" type="text/css" />
</HEAD>
<td height="103" valign="top" background="image/right bj.gif" style="padding-left:20px"><table width="661" border="0" cellspacing="0" cellpadding="0">
<tr>
<tr>
<td width="330" ><div align="left"><img src="<%=mid(rs("P_Pic"),4)%>" width="300" class="border" />
</div>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>产品名称:<b><%=rs("P_name")%></b></td>
</tr>
</table></td>
</tr>
<tr>
<td height="20" colspan="3" class="p12">产品说明:<%=rs("P_Instr")%></td>
</tr>
<tr>
<td height="30" colspan="3" align="right" class="p12">
<% set rss=conn.execute("select top 1 P_ID from P_product where orderId < "&rs("orderId")&" order by orderId desc,P_ID asc")
if not rss.eof and not rss.bof then%><strong>[</strong> <a href="?P_ID=<%=rss(0)%>">前一条</a><strong>]</strong>
<% end if
rss.close%>
<% set rsbb=conn.execute("select top 1 P_ID from P_product where orderId > "&rs("orderId")&" order by orderId asc,P_ID asc")
if not rsbb.eof and not rsbb.bof then%><strong>[</strong> <a href="?P_ID=<%=rsbb(0)%>">后一条</a><strong>]</strong>
<% end if
rsbb.close%>
<!--#include file="end.asp"-->
<%end if
end if%>
</body>
</html>
Pid=Cint(request.QueryString("P_ID"))
if Pid<1 or not isnumeric(Pid) then
response.Write("请勿直接浏览此页面,请返回!")
response.End()
else
set rs=conn.execute("select P_ID,P_Name,P_Pic,P_Instr,orderId from P_product where P_ID="&Pid)
if rs.eof and rs.bof then
response.Write("非法操作,请终止!")
rs.close
conn.close
response.End()
else
'conn.execute("update P_product set Hits=Hits+1 where P_ID="&Pid)
%>
<!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><%=rs(1)%></title>
<link href="css.css" rel="stylesheet" type="text/css" />
</HEAD>
<td height="103" valign="top" background="image/right bj.gif" style="padding-left:20px"><table width="661" border="0" cellspacing="0" cellpadding="0">
<tr>
<tr>
<td width="330" ><div align="left"><img src="<%=mid(rs("P_Pic"),4)%>" width="300" class="border" />
</div>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>产品名称:<b><%=rs("P_name")%></b></td>
</tr>
</table></td>
</tr>
<tr>
<td height="20" colspan="3" class="p12">产品说明:<%=rs("P_Instr")%></td>
</tr>
<tr>
<td height="30" colspan="3" align="right" class="p12">
<% set rss=conn.execute("select top 1 P_ID from P_product where orderId < "&rs("orderId")&" order by orderId desc,P_ID asc")
if not rss.eof and not rss.bof then%><strong>[</strong> <a href="?P_ID=<%=rss(0)%>">前一条</a><strong>]</strong>
<% end if
rss.close%>
<% set rsbb=conn.execute("select top 1 P_ID from P_product where orderId > "&rs("orderId")&" order by orderId asc,P_ID asc")
if not rsbb.eof and not rsbb.bof then%><strong>[</strong> <a href="?P_ID=<%=rsbb(0)%>">后一条</a><strong>]</strong>
<% end if
rsbb.close%>
<!--#include file="end.asp"-->
<%end if
end if%>
</body>
</html>
追问
没有用哦?
追答
怎么会没用,
你在set rs=conn.execute("select P_ID,P_Name,P_Pic,P_Instr,orderId from P_product where P_ID="&Pid)
后面加一句response.write ("select P_ID,P_Name,P_Pic,P_Instr,orderId from P_product where P_ID="&Pid)
把这条语句输出来然后在数据库查询分析器里面执行一下看阿有数据!
展开全部
你把<%
Pid=Cint(request.QueryString("P_ID"))
if Pid<1 or not isnumeric(Pid) then
response.Write("请勿直接浏览此页面,请返回!")
response.End()
else
set rs=conn.execute("select P_ID,P_Name,P_Pic,P_Instr,orderId from P_product where P_ID="&Pid)
if rs.eof and rs.bof then
response.Write("非法操作,请终止!")
rs.close
conn.close
response.End()
else
'conn.execute("update P_product set Hits=Hits+1 where P_ID="&Pid)
%>
放到最前面去然后把
<title>昆山环氧地坪|昆山地坪漆|昆山环氧树脂地坪|昆山无震动止滑车道|昆山防滑车道-昆山华睿达净化科技有限公司</title>换成:<title><%=rs("P_name")%></title>
Pid=Cint(request.QueryString("P_ID"))
if Pid<1 or not isnumeric(Pid) then
response.Write("请勿直接浏览此页面,请返回!")
response.End()
else
set rs=conn.execute("select P_ID,P_Name,P_Pic,P_Instr,orderId from P_product where P_ID="&Pid)
if rs.eof and rs.bof then
response.Write("非法操作,请终止!")
rs.close
conn.close
response.End()
else
'conn.execute("update P_product set Hits=Hits+1 where P_ID="&Pid)
%>
放到最前面去然后把
<title>昆山环氧地坪|昆山地坪漆|昆山环氧树脂地坪|昆山无震动止滑车道|昆山防滑车道-昆山华睿达净化科技有限公司</title>换成:<title><%=rs("P_name")%></title>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
把asp执行代码放到title前面。
然后调用就可以了啊
然后调用就可以了啊
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询