This is the entire script. I just want to open a text file and save it to a variable ($fcontents) to use later.
<?php
$filename ="timestamp.txt";
$myFile = fopen($filename, "r");
$fcontents = file($myFile);
fclose($myFile);
?>
However, I get this error. It seems like this file (timestamp.txt) does not exist, but it definately does and it resides in the same directory as the script.
Warning: file("Resource id #1") - No such file or directory in /home2/happyher/public_html/dev/timestamp.php on line 4
If I tell it to look for a file that does not exist (fakefile.txt for instance), I will receive this:
Warning: fopen("fakefile.txt", "r") - No such file or directory in /home2/happyher/public_html/dev/timestamp.php on line 3
Warning: file("") - No such file or directory in /home2/happyher/public_html/dev/timestamp.php on line 4
Warning: Supplied argument is not a valid File-Handle resource in /home2/happyher/public_html/dev/timestamp.php on line 5
I believe that this line:
$myFile = fopen($filename, "r");
is returning:
"Resource id #1" to $myFile
I have no idea what that means.
Thanks for any help.