Is there any reason why the fread()
function wouldn't work (no errors show up) when reading from a .php file over a .txt file?
code
$file = fopen("db.php","rw");
$data = fgets($file, filesize("db.php"));
echo($data);
fclose($file);
die();
Is there any reason why the fread()
function wouldn't work (no errors show up) when reading from a .php file over a .txt file?
code
$file = fopen("db.php","rw");
$data = fgets($file, filesize("db.php"));
echo($data);
fclose($file);
die();
Is there any reason why the fread() function wouldn't work (no errors show up) when reading from a .php file over a .txt file?
No, not if you're addressing them the same way (same protocol / method / location). They're all just plain data to fread()
.
Are the permissions the same for the .php file and the .txt file? I know that seems obvious but sometimes it's the little things that get by us.