i am trying to read txt file from my webhost using
echo file_get_contents("http://domain/text.txt");
Or
$fh = fopen("http://domain/text.txt", "r");
while (!feof($fh)) {
$line = fgets($fh);
echo $line;
}
but i wanted to protect this text file from direct access
using .htaccess
deny from all
but i couldnt read text file anymore after denied direct access :(
also i dont want use all from ip
so i am asking if there any solution to read the text file with php and deny direct access to the file
Thank You