解决方案 »

  1.   

    计算机是不会骗人老实巴交的家伙,所以这个文件的确应该是存在的.
    输出你的 html_file 然后去相同位置 ,你当前这个文件的目录下查找一下是不是存在吧....
      

  2.   

    在你的机器中搜索 $html_file 表示的文件,一定能找到的
    这种现象偶有发生,应该是 php 的 bug
    一般应给待操作的文件名以路径(相对路径即可,比如 ./)若你的程序段2,是以某种方式循环执行的。
    则应考虑是否是缓存的影响,适当的使用 clearstatcache() 函数
      

  3.   

    file_exists 函数是有缓存的,因而在一定程度上并不准确。如果要排除缓存的影响,可以考虑clearstatcache清理缓存信息。
    手册中有相应说明
      

  4.   

    按视频的做正常,自己写的不正常。基本可以确定不是系统的问题。应该是你的代码问题了。
    echo dirname($html_file); // 加这句看看,是否返回的是当前目录。
      

  5.   

    我发现在ie下结果是正确的,但是的firefox下就会出错。
    clearstatcache()似乎不起作用。create table news(
    id int unsigned primary key auto_increment,
    title varchar(128) not null default '',
    content varchar(256) not null default '',
    filename varchar(32) not null default ''
    )engine=MyISAM charset utf8insert into news(title,content) values('hello1','北京你好');insert into news(title,content) values('hello2','四川你好');
    这是我的表结构,版主有兴趣了可以试试
      

  6.   


    目前发现跟浏览器有关,clearstatcache()不起作用。create table news(
    id int unsigned primary key auto_increment,
    title varchar(128) not null default '',
    content varchar(256) not null default '',
    filename varchar(32) not null default ''
    )engine=MyISAM charset utf8insert into news(title,content) values('hello1','北京你好');insert into news(title,content) values('hello2','四川你好');这是表结构,如有兴趣可以一同进步。
      

  7.   


    目前发现跟浏览器有关,clearstatcache()不起作用。create table news(
    id int unsigned primary key auto_increment,
    title varchar(128) not null default '',
    content varchar(256) not null default '',
    filename varchar(32) not null default ''
    )engine=MyISAM charset utf8insert into news(title,content) values('hello1','北京你好');insert into news(title,content) values('hello2','四川你好');这是表结构,如有兴趣可以一同进步。echo '<tr><td>'.$row['id'].'</td><td>'.$row['title'].'</td><td><a href="showNews.php?id='.$row['id'].'">查看详情</a></td><td><a href="#">修改页面</a></td></tr>';
    把这句改成下面的试试。
    echo '<tr><td>'.$row['id'].'</td><td>'.$row['title'].'</td><td><a href="showNews.php?id='.$row['id'].'&t='.time().'">查看详情</a></td><td><a href="#">修改页面</a></td></tr>';
      

  8.   


    目前发现跟浏览器有关,clearstatcache()不起作用。create table news(
    id int unsigned primary key auto_increment,
    title varchar(128) not null default '',
    content varchar(256) not null default '',
    filename varchar(32) not null default ''
    )engine=MyISAM charset utf8insert into news(title,content) values('hello1','北京你好');insert into news(title,content) values('hello2','四川你好');这是表结构,如有兴趣可以一同进步。echo '<tr><td>'.$row['id'].'</td><td>'.$row['title'].'</td><td><a href="showNews.php?id='.$row['id'].'">查看详情</a></td><td><a href="#">修改页面</a></td></tr>';
    把这句改成下面的试试。
    echo '<tr><td>'.$row['id'].'</td><td>'.$row['title'].'</td><td><a href="showNews.php?id='.$row['id'].'&t='.time().'">查看详情</a></td><td><a href="#">修改页面</a></td></tr>';依然不行
      

  9.   

    chrome,IE都可以,唯独firefox不行,莫非你浏览器内核有关?
      

  10.   

    实在无法重现你说的问题.
    如果静态html文件不存在的话,file_get_contents也会触发错误,那么你应该无法继续输出static字样。
    所以还是怀疑html文件是存在“某个角落”里的,不妨对你的include path和document_root目录检查下
      

  11.   


    我也觉得奇怪,我在windows下,搜索html文件,确实不存在。
    这段程序在chrome,IE都可以,就是firefox不行。
    我用360彻底清除缓存,还是会出现上述问题。