有一TXT文件在客户端的C:\123.txt
内容只有 A 字
PHP 登入时先读取C:\123.txt 及 $Content = 内容
目的是要确定客户使用特定的电脑登入
$file = file ('c:\123.txt');
$file = fopen("C:\\123.txt","r");
都出错
Warning: file(c:\123.txt)[function.file]:failed to open stream: No such file or directory
请指教
不可能
追答$file = fopen("C:\\123.txt","r");
你这个的错误信息是什么啊 应该不是上面的错误信息吧
Warning: fopen(C:\123.txt) [function.fopen]: failed to open stream: No such file or directory
追答你是不是把两行代码写一起的?
如果写一起的话 先把$file = file ('c:\123.txt'); 隐藏下
只运行$file = fopen("C:\\123.txt","r"); 这句
两行代码是分别试行, 不可能写在一起的
追答我在自己的电脑上测试了
$file = fopen("C:\\123.txt","r");
这句代码 毫无问题
我觉得可能出现的原因:第一路径要对, 123.txt确实存在 第二 要有123.txt的操作权限
PHP页在远端服务器,TXT文件在客户端
是否不可能的啊!
如判断C:\a.txt 存在否,可以吗? 又如何写
如可以,我去找 a.txt, b.txt,c.txt 也可以啊
。。。。额 才看明白。。。原来你文件和代码不是一个服务器啊。。。晕
php一个脚本语言。。据我所知 做不到。。可能我孤陋寡闻
如判断C:\a.txt 存在否,可以吗?
做了
$s = ('d:\\123.txt');
if (file_exists($s)) {
echo "The file exists";
} else {
echo "The file does not exist";
}
老是不存在
其它语言 可以吗?