Thanks in advance for your time and responses.
I need to remotely (not sure if this is the correct term) open and read a text file, then display that information in a web page. Not sure how to do this. I have tried this on a text file on the same server with no problem, but how do I access a file on a different server?
This is the code I had for the script that reads the text file on the same server.
<?php
$opFile = "books.txt";
$fp = fopen($opFile,"r") or die("Error Reading File");
$data = fread($fp, filesize($opFile));
fclose($fp);
$line = explode("\n", $data);
$i=count($line);
for ($n=0 ; $n < $i-1 ; $n++ ) {
$listings = explode("|", $line[$n]);
echo "Book Title: " .$listings[0]."<br>";
echo "Author: " .$listings[1]."<br>";
echo "Date Published: " .$listings[2]."<br><br>";
}
?>
So, as an example, how do I change this to read a text file at:
exampledomain.com/files/books.txt
Major newbie here, so sorry if this is confusing.
Thanks again!