你放file_exists($filename)语句的那PHP文件与 Digithermo_2.jpg 的路经关系是...

解决方案 »

  1.   

    $filename="/htdocs/image/bathroom_scales/Product/Thermometers/Digithermo_2.jpg"
    应该没问题
    也可换成
    $filename="//htdocs//image//bathroom_scales//Product//Thermometers//Digithermo_2.jpg"
      

  2.   

    放file_exists($filename)语句的那PHP文件与 Digithermo_2.jpg 的路经关系是...是這樣:是它父的父下的image/bathroom_scales/Product/Thermometers/Digithermo_2.jpg
      

  3.   

    这样把,假设文件
    文件1: php/1.php
    文件2: image/1.jpg在1.php中用$filename="../image/1.jpg";
    file_exists($filename);
      

  4.   

    这样写没有任何问题 file_exists($filename)
    你也可写作 file_exists(realpath($filename))
      

  5.   

    这样写没有任何问题 file_exists($filename)
    你也可写作 file_exists(realpath($filename))
      

  6.   

    to  xuzuning(唠叨)realpath("../image/1.jpg")
    realpath("../../image/1.jpg")這兩個返回的值是一樣的!!!
      

  7.   

    不会的

    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
      

  8.   

    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
    的相對路徑?
      

  9.   

    这样把,假设文件 d:/web/ 能运行PHP放一个文件(1.jpg)在这目录下,也就是 d:/web/1.jpg在写个php页面(1.php),内容就是if (file_exists("1.jpg")){
       echo "有";
    }else{
       echo "没有";
    }然后你用ie运行1.php看看.如果还没有结果,我就没有办法了.本人能力也就这样了.
      

  10.   

    $filename="你的文件的绝对路径"
    如果用绝对路径的话使没有问题的!
    如果用想对路径的话,起始点是这个网页源代码所在地的路径
    "../"是指上一级目录!
    在php的文件系统函数中都是这样的(包括file_exists)