| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 550 人关注过本帖
标题:[求助]这个变量传送怎么传
只看楼主 加入收藏
垃圾的沉默
Rank: 1
等 级:新手上路
威 望:2
帖 子:511
专家分:0
注 册:2007-6-25
收藏
 问题点数:0 回复次数:4 
[求助]这个变量传送怎么传

这是一个生成网站的文件
成文件
<!--#include file="inc.asp" -->
<%
ClassID=3
if ClassID=0 or ClassID="" then
response.write "ClassID Error"
response.End()
else
set rs=server.createobject("adodb.recordset")
sql="select * from GClass where ID="&ClassID&" order by ID asc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "ClassID Search Error"
response.End()
else
ClassTitle=rs("Title")
Classurl="$site_url$/Info"&ClassID&"_1.html"
end if
rs.close
end if
BaseMB=MBinfo(11)
BaseMB = replace(BaseMB,"$头文件$",MBinfo(1))
BaseMB = replace(BaseMB,"$版权信息$",MBinfo(2))
BaseMB = replace(BaseMB,"$主分类列表$",Main_Border_List())
BaseMB = replace(BaseMB,"$单页信息$",Text_Bottom_list())
BaseMB = replace(BaseMB,"$附导航$",F_Border_List())
BaseMB = replace(BaseMB,"$友情链接$",frendlink())
'-------------k------------
BaseMB = replace(BaseMB,"$热点推荐$",K1_List_1())
'------------栏目-------------

set rs=server.createobject("adodb.recordset")
sql="select * from GInfo where ClassID=3 order by ID desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
else
do while not rs.eof
site_Title=rs("H1")&" - "&site_name
site_description=rs("H1")
site_keywords=rs("keyword")
set rsBorder=server.createobject("adodb.recordset")

rsBorder.open sql,conn,1,1
rsBorder.close
if rs("writer")="" then
writer="$site_name$"
else
writer=rs("writer")
end if
FileCount=getKey(rs("Content"))

filename=rs("filename")
Filebox=left(filename,instr(filename,"/"))
CheckAndCreateFolder("../../"&Filebox)
session("H1")=rs("H1")
'---------开始写文件
fileMB=BaseMB
voteincdir = server.mappath("../../"&filename)
set fs = CreateObject("Scripting.FileSystemObject")
set ts = fs.OpenTextFile(voteincdir,2, True)
'-------这里替换相关数据-----------------
fileMB = replace(fileMB,"$site_Title$",site_Title)
fileMB = replace(fileMB,"$site_description$",site_description)
fileMB = replace(fileMB,"$site_keywords$",site_keywords)

fileMB = replace(fileMB,"$文章标题H1$",rs("H1"))
fileMB = replace(fileMB,"$文章标题H2$",rs("H2"))
fileMB = replace(fileMB,"$文章标题H3$",rs("H3"))
fileMB = replace(fileMB,"$关键字$",rs("keyword"))

fileMB = replace(fileMB,"$发布时间$",rs("date"))
fileMB = replace(fileMB,"$作者$",writer)
fileMB = replace(fileMB,"$内容$",FileCount)


ads_1="<table border=0 align=left cellpadding=5 cellspacing=1 class=showword bgcolor='C6E4FE'><tr><td bgcolor='#ffffff'>$文章内部广告$</td></tr></table>"
fileMB = replace(fileMB,"$文章内部广告$",ads_1)
fileMB = replace(fileMB,"$文章内部广告$",ADinfo_file(rs("BorderID")))

fileMB = replace(fileMB,"$Google提供的广告$",ADinfo(2))
fileMB = replace(fileMB,"$百度主题推广$",ADinfo(3))
fileMB = replace(fileMB,"$栏目标题A$",TitleA(3))
fileMB = replace(fileMB,"$栏目标题B$",TitleB(3))
fileMB = replace(fileMB,"$栏目标题C$",TitleC(3))
fileMB = replace(fileMB,"$栏目标题D$",TitleD(3))
fileMB = replace(fileMB,"$栏目A$",Lei_A(3))
fileMB = replace(fileMB,"$栏目B$",Lei_B(3))
fileMB = replace(fileMB,"$栏目C$",Lei_C(3))
fileMB = replace(fileMB,"$相关报告A$","$site_url$/Report_"&BorderID&"_1.html")

fileMB = replace(fileMB,"$相关链接$",Info_list_Top(ClassID,BorderID,5,55,0))
fileMB = replace(fileMB,"$相关研究报告$",Report_list_Top(BorderID,5))
fileMB = replace(fileMB,"$Keyword$",K2_ListB())


fileMB = replace(fileMB,"$单页信息$",Text_Bottom_list())
fileMB = replace(fileMB,"$BorderTitle$",BorderTitle)
fileMB = replace(fileMB,"$Borderurl$",Borderurl)
fileMB = replace(fileMB,"$ClassTitle$",ClassTitle)
fileMB = replace(fileMB,"$Classurl$",Classurl)

fileMB = replace(fileMB,"$site_name$",site_name)
fileMB = replace(fileMB,"$site_url$",site_url)
ts.Write fileMB
ts.close
response.write FileName&"<br>"
'-----------
rs.movenext
loop
end if
rs.close
response.write "ok"

response.write "更新完成,<a href='modi.asp'>点这里返回</a>"
%>



inc.asp
<%
function Lei_A(ClassID)
H1=Session("H1")
Information =""
set rsInfo=server.createobject("adodb.recordset")
sql="select * from Lei_A where ClassID="&ClassID&" and keyword="&H1&" order by key_id desc"
rsInfo.open sql,conn,1,1
if rsInfo.eof and rsInfo.bof then
Information =Information &"-"
else
Information =Information &"<table width='100%' border=0 align=center cellpadding=0 cellspacing=0 class=word>"
K_TDcount=1
do while not rsInfo.eof
if K_TDcount>12 then
exit do
end if
K_TDcount=K_TDcount+1

Information =Information &"<tr align=left>"
for TDcount=1 to 1
if rsInfo.eof then
Information =Information &"<td>&nbsp;</td>"
else
Information =Information &"<td width='50%'>"
Information =Information &"<a href='"&rsInfo("url")&"' target=_blank>"&rsInfo("Title")&"</a>"
Information =Information &"</td>"
rsInfo.movenext
end if
next
Information =Information &"</tr>"
loop
Information =Information &"</table>"
end if
rsInfo.close
Lei_A=Information
end function
%>

想把生文件里的的Ginfo表中的H1列作为inc.asp 里的一个查询条件..怎么把这个值传送过来

搜索更多相关主题的帖子: 变量 ClassID response 
2007-08-03 14:31
rtc
Rank: 2
等 级:新手上路
威 望:4
帖 子:590
专家分:0
注 册:2007-6-6
收藏
得分:0 
你做什么吖??
生成html??
你的网站很大型吗
2007-08-03 15:25
阳光白雪
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:39
帖 子:2220
专家分:0
注 册:2005-11-18
收藏
得分:0 

<!--#include file="inc.asp" -->
放到
session("H1")=rs("H1")
这句后面的任意位置

专注于WEB前端交互平台开发:[url=http://blog./]blog.[/url](富客户端技术(RIA)交流平台)
2007-08-03 15:28
垃圾的沉默
Rank: 1
等 级:新手上路
威 望:2
帖 子:511
专家分:0
注 册:2007-6-25
收藏
得分:0 
谢版主..问题解决.

人们笑我太疯癫...我笑人们太正经
2007-08-03 15:46
守株待爱
Rank: 1
等 级:新手上路
帖 子:33
专家分:0
注 册:2007-8-4
收藏
得分:0 

我的asp网页里有下面一条语句
if rs("catename")="系部公告" then
我是想做新闻更新系统,当类型等于"系部公告"时,新闻按时间降序出现在下面,但这条语句不起作用,请问应该怎么改?ASP里面允不允许出现这样的语句

另外一个是
……
rs.open"select title,posttime,id from news order by posttime DESC",dbconnection,1,3
……
<a href="newsview.asp?id=<%=rs.fields(2).value%>><%=rs.fields(0).value%></a>
……
我希望点击“<%=rs.fields(0).value%>”这个链接的时候,把参数“id=<%=rs.fields(2).value%>”传到newsview.asp页面,在这个页面里浏览新闻的内容,可点击后地址栏里出现的是“newsview.asp?id=”。
请问哥们,以上几个问题怎么解决,菜鸟新学,在此停了两天了。再一次谢谢!


人生不能像做菜,要等什么都准备好了才能下锅.
2007-08-04 17:30
快速回复:[求助]这个变量传送怎么传
数据加载中...
 
   



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

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