<?php
$top = "../top.txt";
$middle = "../middle.txt";
$bottom = "../bottom.txt";
$end = "/st.txt";
$data = "/dt.txt";
$handle1 = fopen($top, "r");
$contents1 = fread($handle1, filesize($top));
fclose($handle1);
$handle2 = fopen($end, "r");
$contents2 = fread($handle2, filesize($end));
fclose($handle2);
$handle3 = fopen($middle, "r");
$contents3 = fread($handle3, filesize($middle));
fclose($handle3);
$handle4 = fopen($data, "r");
$contents4 = fread($handle4, filesize($data));
fclose($handle4);
$handle5 = fopen($bottom, "r");
$contents5 = fread($handle5, filesize($bottom));
fclose($handle5);
echo $contents1;
echo $contents2;
echo $contents3;
echo $contents4;
echo $contents5;
?>
我对其中每一个都收到以下错误:
警告:fopen(../top.txt)[function.fopen]:无法打开流:没有这样的文件或目录
警告:filesize() [function.filesize]:../top.txt 统计失败
警告:fread():提供的参数不是有效的流资源
警告:fclose():提供的参数不是有效的流资源
所有文件和文件夹中的 CHMOD 并设置为 777
所有文件都存在于服务器上
服务器上安装了PHP5
我究竟做错了什么?
使用整个路径,而不是../top.txt
use
/path/to/top.txt
OR
你也用$top = $_SERVER['DOCUMENT_ROOT'] . "/../top.txt";
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)