I see, well that was pretty silly of me - however, I'm trying to open a file now on my C: drive that I know is there and has the path of - "C:\hello.txt".
Here is my PHP code, and the errors I get:
Code:
<?php
$filename = 'C:\\hello.txt';
$file = fopen($filename,"r");
$contents = fread($file, filesize($filename));
fclose($file);
echo $contents;
?>
Code:
Warning: fopen(C:\hello.txt) [function.fopen]: failed to open stream: No such file or directory in /mnt/local/home/garlandsails/bristoldnb.co.uk/php/index.php on line 12
Warning: filesize() [function.filesize]: stat failed for C:\hello.txt in /mnt/local/home/garlandsails/bristoldnb.co.uk/php/index.php on line 14
Warning: fread(): supplied argument is not a valid stream resource in /mnt/local/home/garlandsails/bristoldnb.co.uk/php/index.php on line 14
Warning: fclose(): supplied argument is not a valid stream resource in /mnt/local/home/garlandsails/bristoldnb.co.uk/php/index.php on line 15
I managed to get it to work for a file on the server, just not a local file - no errors but nothing showed up, any more suggestions?
I've also tried C:\hello.txt, C:/hello.txt but both got me nowhere.
Thanks for your help thus far,
Jack
Bookmarks