<?
$fp = fopen("d:/Apache2.2/htdocs/bob/hello.txt",'r');
fwrite($fp,$outputstring);
?>看书自学中 小弟问一下 这个是不是写入了$outputstring在fp打开的hello.txt文件里? 我打开hello文件 里面依旧是空的啊 没有写入 程序没有报错 不是很明白这个写入的语句 求指教 书上这节就写这么多 没看明白
$fp = fopen("d:/Apache2.2/htdocs/bob/hello.txt",'r');
fwrite($fp,$outputstring);
?>看书自学中 小弟问一下 这个是不是写入了$outputstring在fp打开的hello.txt文件里? 我打开hello文件 里面依旧是空的啊 没有写入 程序没有报错 不是很明白这个写入的语句 求指教 书上这节就写这么多 没看明白
$DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
$fp = fopen("DOCUMENT_ROOT/../bob/hello.txt",'ab');
fwrite($fp,$outputstring);但是报错了···
Warning: fopen(DOCUMENT_ROOT/../bob/hello.txt) [function.fopen]: failed to open stream: No such file or directory in D:\Apache2.2\htdocs\bob\data.php on line 42
$fp = fopen("$DOCUMENT_ROOT/../bob/hello.txt",'ab');
fwrite($fp,$outputstring);