file_exists($filename)中文件路徑的問題??? 你放file_exists($filename)语句的那PHP文件与 Digithermo_2.jpg 的路经关系是... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $filename="/htdocs/image/bathroom_scales/Product/Thermometers/Digithermo_2.jpg"应该没问题也可换成$filename="//htdocs//image//bathroom_scales//Product//Thermometers//Digithermo_2.jpg" 放file_exists($filename)语句的那PHP文件与 Digithermo_2.jpg 的路经关系是...是這樣:是它父的父下的image/bathroom_scales/Product/Thermometers/Digithermo_2.jpg 这样把,假设文件文件1: php/1.php文件2: image/1.jpg在1.php中用$filename="../image/1.jpg";file_exists($filename); 这样写没有任何问题 file_exists($filename)你也可写作 file_exists(realpath($filename)) 这样写没有任何问题 file_exists($filename)你也可写作 file_exists(realpath($filename)) to xuzuning(唠叨)realpath("../image/1.jpg")realpath("../../image/1.jpg")這兩個返回的值是一樣的!!! 不会的设c:/program files/apache group/apache/htdocs/image/bathroom_scales/Product/Thermometersc:/program files/apache group/apache/htdocs/main/test.php在test.php中realpath("../image/1.jpg") 为c:/program files/apache group/apache/htdocs/image/1.jpgrealpath("../../image/1.jpg") 为c:/program files/apache group/apache/image/1.jpg a.html 文件 b.php 文件 c.jpg文件在 a.html 中用 b.php 下載 c.jpgc:\aa\bb1\cc1\dd\ee\a.htmlc:\aa\bb2\cc2\b.phpc:\aa\bb1\cc1\image\bathroom_scales\Product\Thermometers\c.jpgc:\aa 為 web 根目錄a.html<a href=\bb\cc\b.php?filename=../../../image\bathroom_scales\Product\Thermometers\c.jpg>test download</a>我用的是與 a.html 的相對路徑, 是不是不對? 應用 b.php的相對路徑? 这样把,假设文件 d:/web/ 能运行PHP放一个文件(1.jpg)在这目录下,也就是 d:/web/1.jpg在写个php页面(1.php),内容就是if (file_exists("1.jpg")){ echo "有";}else{ echo "没有";}然后你用ie运行1.php看看.如果还没有结果,我就没有办法了.本人能力也就这样了. $filename="你的文件的绝对路径"如果用绝对路径的话使没有问题的!如果用想对路径的话,起始点是这个网页源代码所在地的路径"../"是指上一级目录!在php的文件系统函数中都是这样的(包括file_exists) 做个东西, 但是没什么头绪. PHP中的更新数据问题!分少再加!!!!!!!! 指定替换某一次匹配的内容 登录问题! 为什么fckeditor2.5编辑器编辑的内容会多出换行符号呢 那位给解析一下session_set_save_handler(),看了半天不知道它用来干什么? 表单提交问题 请问:在Javascript中如何调用PHP中的数组变量? 请教一下,www.go2map.com 的寻找 最佳路线的算法如何实现的,给分 我提个问题?!请大家帮我解决! 哪里有关于开发论坛或者聊天室的详细说明过程? 检查域名是否被注册的代码有没有?asp&php都可以,在线等待。
应该没问题
也可换成
$filename="//htdocs//image//bathroom_scales//Product//Thermometers//Digithermo_2.jpg"
文件1: php/1.php
文件2: image/1.jpg在1.php中用$filename="../image/1.jpg";
file_exists($filename);
你也可写作 file_exists(realpath($filename))
你也可写作 file_exists(realpath($filename))
realpath("../../image/1.jpg")這兩個返回的值是一樣的!!!
设
c:/program files/apache group/apache/htdocs/image/bathroom_scales/Product/Thermometers
c:/program files/apache group/apache/htdocs/main/test.php在test.php中
realpath("../image/1.jpg")
为c:/program files/apache group/apache/htdocs/image/1.jpg
realpath("../../image/1.jpg")
为c:/program files/apache group/apache/image/1.jpg
在 a.html 中用 b.php 下載 c.jpgc:\aa\bb1\cc1\dd\ee\a.htmlc:\aa\bb2\cc2\b.phpc:\aa\bb1\cc1\image\bathroom_scales\Product\Thermometers\c.jpgc:\aa 為 web 根目錄a.html
<a href=\bb\cc\b.php?filename=../../../image\bathroom_scales\Product\Thermometers\c.jpg>test download</a>我用的是與 a.html 的相對路徑, 是不是不對? 應用 b.php
的相對路徑?
echo "有";
}else{
echo "没有";
}然后你用ie运行1.php看看.如果还没有结果,我就没有办法了.本人能力也就这样了.
如果用绝对路径的话使没有问题的!
如果用想对路径的话,起始点是这个网页源代码所在地的路径
"../"是指上一级目录!
在php的文件系统函数中都是这样的(包括file_exists)