大家测试一下假设你有两个php (a.php b.php) 在同一级目录 c 下 a.php 中有一句 include "./b.php";访问 /c/a.php?aaa=bbb 是正确的 而访问 /c/a.php/?aaa=bbb 将得到可爱的: Warning: main(./b.php) [function.main]: failed to open stream: No such file or directory in ...(写成 include "b.php"; 就没问题了)
而访问 /c/a.php/?aaa=bbb 将得到可爱的: Warning: main(./b.php) [function.main]: failed to open stream: No such file or directory in ...(写成 include "b.php"; 就没问题了)----------这似乎是 $_GET 注入的问题了 ~~
may you use mod_rewrite to fix this problem RewriteRule ^/index.php/$ /abc [L,R]当然,我没有测试过。再者 ,建议在 include 的时候不要使用 ./ 这种方式,而使用 添加到 include_path 中的路径的相对路径 ,比如 /usr/local/php/abc.inc /usr/local 在include_path 中,可以使用 include("php/abc.inc") 这样引用,另外,你出现这个问题,应该是由于 css 的引用没有使用绝对路径的原因,所以这样的最好还是使用绝对路径引用。
好多网站有这个问题
AcceptPathInfo Off
重启apache
语法: AcceptPathInfo On|Off|Default
默认值: AcceptPathInfo Default
上下文: 服务器配置, 虚拟主机, 目录, .htaccess
覆盖项: FileInfo
状态: 核心
模块: core
兼容性: Apache 2.0.30或更新版本
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
http://www.discuz.net/index.php/?a=f
a.php 中有一句 include "./b.php";访问 /c/a.php?aaa=bbb 是正确的
而访问 /c/a.php/?aaa=bbb 将得到可爱的:
Warning: main(./b.php) [function.main]: failed to open stream: No such file or directory in ...(写成 include "b.php"; 就没问题了)
path_info对于cgi程序不是同步的,就是说cgi程序认为是进入了下一级目录,所以include文件或者链接要用绝对路径这个根本就不是问题的问题,你url打错了当然会有意想不到的后果
Warning: main(./b.php) [function.main]: failed to open stream: No such file or directory in ...(写成 include "b.php"; 就没问题了)----------这似乎是 $_GET 注入的问题了 ~~
/usr/local 在include_path 中,可以使用 include("php/abc.inc") 这样引用,另外,你出现这个问题,应该是由于 css 的引用没有使用绝对路径的原因,所以这样的最好还是使用绝对路径引用。
http://bbs.chinaunix.net/index.php/index.php
1 你自己去改apache1.3的源码
2 用apache2两条路自己选吧
为什么大家都说的这么麻烦呢。。没这么麻烦啦
$CF_DOMAIN = 'http://XXX.XXX.com';//地址头
$CF_ADMIN_DIR = 'admin';//看第一个斜杠是否是这个字符串
$CF_do_me = '你的页面';//看看提交过来的时不时这个页
$hr = explode('/',substr($_SERVER[HTTP_REFERER],7));
if($hr[0] != $CF_DOMAIN || $hr[1] != $CF_ADMIN_DIR || !ereg($CF_do_me,$hr[3])){
header("Location:你出错的页.php?err=not finded");exit;
}根据你自己的程序改下吧