同一个包含文件,为什么在首页无效,而在次页面有效

java998 2003-11-27 11:06:35
包含文件放在public下,包含文件的路径没错,
这是首页的原代码:
<!--#include file="includes/conn.asp" -->
<!--#include file="includes/AspFun.asp"-->
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="Config/Style.css" type="text/css">
<link href="css.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
<div align="center">
<%pageLevel=1%>
<table width="762" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><!--#include file="public/header.asp" --></td>
</tr>
</table>
<div align="center">
。。。

这是次页面的原代码

<%
Dim Info_Id '当前信息ID(2级)
Dim StrKeyWord

'从上一页读取信息的类别
Info_Id=Request.QueryString ("Info_Id")
StrKeyWord=Request.QueryString ("StrKeyWord")

%>
<!--#include file="../includes/conn.asp" -->
<!--#include file="../includes/AspFun.asp"-->

<html>
<head>
<title>怀柔私个协</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../Config/Style0.css" rel="stylesheet" type="text/css">
<script language="javaScript" src="../includec/check.js"></script>


<link href="../Config/Style.css" rel="stylesheet" type="text/css">
<link href="../css.css" rel="stylesheet" type="text/css">
<body bgcolor="#FFFFFF" background="../display/images/di.gif" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<!--#include file="../public/header.asp" -->
<%set RsInfo=server.CreateObject ("adodb.recordset")
。。。

谢谢!!

...全文
276 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
pipifirst 2003-11-27
  • 打赏
  • 举报
回复
可顶是路径问题!
好好想想就可以解决了!
despider 2003-11-27
  • 打赏
  • 举报
回复
<!--#include virtual="绝对路径"-->
其中“绝对路径”是iis中设置的目录的路径,以'/'开头
despider 2003-11-27
  • 打赏
  • 举报
回复
<!--#include vitual="绝对路径"-->
其中“绝对路径”是iis中设置的目录的路径,以'/'开头
bluesmile979 2003-11-27
  • 打赏
  • 举报
回复
把这些放到include前面看看行不行

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="Config/Style.css" type="text/css">
<link href="css.css" rel="stylesheet" type="text/css">
</head>
xinxian1366 2003-11-27
  • 打赏
  • 举报
回复
<!--#include file="includes/conn.asp" -->
<!--#include file="includes/AspFun.asp"-->
这两个文件中的代码涉及到路径问题时,最好从根目录开始写
如果用../../aaa/ddd.asp这样的方式,那么就会找不到文件,实际上还是路径错了

看情况,应该是没有找到数据库吧
甘泉123 2003-11-27
  • 打赏
  • 举报
回复
“首页无效”是什么意思???
是报错,找不到包含文件,还是包含文件中的东西没显示?
springRainyao 2003-11-27
  • 打赏
  • 举报
回复
包含文件引用应该从当前页的同一级目录开始省略.....
如果首页与includes、public在同一级目录(物理或虚拟目录)时引用才有效
你的情况应该是次页面和includes、public在同一级目录。
Tal 2003-11-27
  • 打赏
  • 举报
回复
相对路径
找不到文件就回出错
cdsun 2003-11-27
  • 打赏
  • 举报
回复
找不到包含文件,还是包含文件中的东西没显示?
YUFEI72 2003-11-27
  • 打赏
  • 举报
回复
还是个相对路径的问题
java998 2003-11-27
  • 打赏
  • 举报
回复
monkeys(study.net):你好:
这个问题已经解决,谢谢!!
以下是header.asp的原代码:
<!--#include file="../includes/aspfun.asp"-->
<%'ÅжÏÒ³Ãæ¼¶Êý
if pageLevel=1 then
hrefPath=hrefPathurl(1)
else
hrefPath=hrefPathurl(2)
end if
'response.write pageLevel
'response.end
%>
<link href="../css.css" rel="stylesheet" type="text/css">

<table width="760" border="0" cellspacing="0" cellpadding="0" align="center" class="table-bordercolor" >
<tr>
<td width="165" height="88" valign="top"><img src="<%=hrefPath%>images/images_01.gif" width=165 height=88>
</td>
<td width="593" height="88" valign="top"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="595" height="88">
<param name="movie" value="<%=hrefPath%>images/banner.swf">
<param name="quality" value="high">
<embed src="<%=hrefPath%>images/banner.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="595" height="88"></embed></object></td>
</tr>
</table>
monkeys 2003-11-27
  • 打赏
  • 举报
回复
建议你将那段代码贴出来,方便大家帮你
java998 2003-11-27
  • 打赏
  • 举报
回复
大家好:
“同一个包含文件,为什么在首页无效,而在次页面有效”这个问题已经解决,
问题不在以下
<!--#include file="../public/header.asp-->
<!--#include file="public/header.asp" -->
包含文件的路径问题,而在header.asp文件里的FLASH的路径问题,找不到FLASH的文件,
谢谢大家!!!



28,407

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧