Using readfile() to read HTML to a variable
Posted: Tue Aug 23, 2005 2:34 pm
Hi again dudes.
This question shouldn't be so hard
Anyway...
I have 2 HTML files on my server, and I want to take all of the contents of each file into a variable in a PHP script.
So, f.e.
Is this the best way to go about doing this? Is there a better function for this job?
I have tried the above, but get this error:
Thanks for any help.
This question shouldn't be so hard
Anyway...
I have 2 HTML files on my server, and I want to take all of the contents of each file into a variable in a PHP script.
So, f.e.
Code: Select all
$message = readfile('fullurltohtmlfile');
$message .= $_POST['messagebody'];
$message .= readfile('fullurltohtmlfile');I have tried the above, but get this error:
Code: Select all
PHP Warning: readfile(http://www.wrightandshields.co.uk/JayMail/templates/WrightandShields/header.html): failed to open stream: Bad file descriptor in D:\Webspace\wrightandshields.co.uk\wwwroot\JayMail\index.php on line 66 PHP Warning: readfile(http://www.wrightandshields.co.uk/JayMail/templates/WrightandShields/footer.html): failed to open stream: Bad file descriptor in D:\Webspace\wrightandshields.co.uk\wwwroot\JayMail\index.php on line 68 PHP Fatal error: Maximum execution time of 30 seconds exceeded in D:\Webspace\wrightandshields.co.uk\wwwroot\JayMail\index.php on line 68