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? Quote 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); Quote 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. Quote 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. Quote 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? Quote 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). Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.