
March 22nd, 2000, 09:43 AM
|
|
Gödelian monster
|
|
Join Date: Jul 1999
Location: Central Florida, USA
|
|
|
1. Have you tried:
include('filename.html');
This should just include the contents of a file into your PHP script. This can cause problems if the file you're including has elements that PHP tries to parse--which you don't want parsed.
2. This script will pass any external file to the browser through your script.
<?php
$filename = "http://www.yoururl.com/";
$fd = fopen("http://www.yoururl.com/", "r");
fpassthru($fd);
?>
3. This script opens a file, turns the contents into a variable, with which you can do whatever you want, but it only works with local server files.
<?php
$filename = "/usr/home/yourdirectory/public_html/htmlfile.html";
$fd = fopen($filename,"r");
$contents = fread($fd,filesize($filename));
fclose($fd);
echo $contents;
?>
Also, you could use fopen() for a remote URL, and then fwrite() to save the file locally, and then do what you want with it with fread().
|