Kolusion Posted August 20, 2011 Share Posted August 20, 2011 I am trying to make PHP output a file in html and using the following code. <?php readfile("./1/index.html"); ?> ... but it isn't working. How would I get PHP to output a file as HTML? Link to comment https://forums.phpfreaks.com/topic/245268-making-php-output-a-file-in-html/ Share on other sites More sharing options...
Kolusion Posted August 20, 2011 Author Share Posted August 20, 2011 ... also tried this: int readfile ($./1/index.html); Link to comment https://forums.phpfreaks.com/topic/245268-making-php-output-a-file-in-html/#findComment-1259715 Share on other sites More sharing options...
trq Posted August 20, 2011 Share Posted August 20, 2011 ... also tried this: int readfile ($./1/index.html); That makes no sense at all and will throw a parse error. Just use include. Link to comment https://forums.phpfreaks.com/topic/245268-making-php-output-a-file-in-html/#findComment-1259720 Share on other sites More sharing options...
Kolusion Posted August 20, 2011 Author Share Posted August 20, 2011 Thank you Captain Obvious. I used: <?php include($./1/index.html); ?> .. but it didn't work. Link to comment https://forums.phpfreaks.com/topic/245268-making-php-output-a-file-in-html/#findComment-1259722 Share on other sites More sharing options...
Kolusion Posted August 20, 2011 Author Share Posted August 20, 2011 Could this not be working because this PHP code is embedded into a .html file? Link to comment https://forums.phpfreaks.com/topic/245268-making-php-output-a-file-in-html/#findComment-1259723 Share on other sites More sharing options...
Kolusion Posted August 20, 2011 Author Share Posted August 20, 2011 My initial line of code was correct. It seems it cannot be output into a HTML TABLE (where this code resides). Link to comment https://forums.phpfreaks.com/topic/245268-making-php-output-a-file-in-html/#findComment-1259725 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.