Hello,
I'm a recent convert from CGI/Perl and so am still getting my feet wet
in PHP.
Here's my code:
$filename = http://www.myserver.com/include/sometext.txt;;
$handle = fopen ($filename, rb);
$contents = fread ($handle, filesize ($filename));
fclose ($handle);
echo $contents;
exit;
The
Hello,
The PHP manual page for filesize
(http://www.php.net/manual/en/function.filesize.php) mentions that it
will not work on remote files. fread will stop once n number of bytes
are read or EOF is received so you could set this to the maximum file
size (in bytes) that you want to download.
On Mon, 27 Jan 2003, Guru Geek wrote:
Hello,
I'm a recent convert from CGI/Perl and so am still getting my feet wet
in PHP.
Here's my code:
$filename = http://www.myserver.com/include/sometext.txt;;
$handle = fopen ($filename, rb);
$contents = fread ($handle, filesize ($filename));
Here's my code now:
$filename =
/usr/local/plesk/apache/vhosts/myserver.com/httpdocs/include/text.txt;
$handle = fopen ($filename, r);
$contents = fread ($handle, filesize ($filename));
fclose ($handle);
echo readfile($filename);
exit;
now it displays the contents of the text.txt file. I
Sorry, here is the code now ( I need a nap )
$filename
=/usr/local/plesk/apache/vhosts/myserver.com/httpdocs/include/text.txt;
$handle = fopen ($filename, r);
$contents = fread ($handle, filesize ($filename));
fclose ($handle);
echo $contents;
exit;
Guru Geek wrote:
Here's my code now:
On Mon, 27 Jan 2003, Guru Geek wrote:
Sorry, here is the code now ( I need a nap )
$filename
=/usr/local/plesk/apache/vhosts/myserver.com/httpdocs/include/text.txt;
$handle = fopen ($filename, r);
$contents = fread ($handle, filesize ($filename));
fclose ($handle);
echo $contents;
exit;
In all actuality I will be manipulating the information that is in that file.
I'm trying to build a log in script. The id's and passwords are stored in a
text file. I'm trying to read that text file so I can compare what the
user/viewer had typed in the id and password boxes. I'm so new to PHP
7 matches
Mail list logo