Please send questions to
st10@humboldt.edu .
<html>
<!-- files4.php
by: Sharon Tuttle
last modified: 12-05-06
-->
<head>
<title> playing with PHP and files - 4 </title>
</head>
<body>
<h2> playing with PHP and files - 4 </h2>
<h3>
<?php
print "About to open REMOTE file on sorrel, HOWDY.txt<br><br>\n";
$remoteFile = fopen("http://www.humboldt.edu/~st10/HOWDY.txt", "r")
or exit("Cannot open HOWDY.txt on sorrel<br>\n");
// print all non-empty lines read from this URL
while (! feof( $remoteFile ) )
{
$nextLine = fgets( $remoteFile );
// ignoring empty lines
if ( strlen( $nextLine ) > 0 )
{
print $nextLine . "<br>\n";
}
}
fclose( $remoteFile );
?>
</h3>
</body>
</head>