PHP Basics In Pictures
Display files
  1. Create a new script with this code:


    $myfile = fopen ('textthought.txt', 'r') or die ("Can not open file");

    while (!feof($myfile)){
    $line = fgets($myfile,5000);
    print "$line <br>"; }


  2. Save the file as textviewer.php in the PHPSCRIPTS folder, upload it to the phpscripts directory on the Web server.

    Here's what the relevant lines in this script do: