mallen Posted October 18, 2012 Share Posted October 18, 2012 I have a PHP page that contains a large mixture of PHP and HTML. I am working on a mobile theme for a website and I am triying to figure a way to load this section of code rather than using "echo" for each line. If there a way to do something like: include( this php page....) echo " mypage.php"; Link to comment https://forums.phpfreaks.com/topic/269642-possbile-to-print-output-of-another-php-page/ Share on other sites More sharing options...
Jessica Posted October 18, 2012 Share Posted October 18, 2012 Look into templating engines like Smarty. Link to comment https://forums.phpfreaks.com/topic/269642-possbile-to-print-output-of-another-php-page/#findComment-1386094 Share on other sites More sharing options...
mallen Posted October 18, 2012 Author Share Posted October 18, 2012 I was able to get it to work. The solution is: <?php $pageinfo = file_get_contents('http://www.mysite.com/file.php'); echo $pageinfo; Link to comment https://forums.phpfreaks.com/topic/269642-possbile-to-print-output-of-another-php-page/#findComment-1386109 Share on other sites More sharing options...
Christian F. Posted October 18, 2012 Share Posted October 18, 2012 That's wrong on so many levels... I really recommend that you adhere to Jessica's advice, and look into templating engines. You don't have to choose Smarty, if you think it's too big and complex, but you really should be using some kind of templating system none the less. Link to comment https://forums.phpfreaks.com/topic/269642-possbile-to-print-output-of-another-php-page/#findComment-1386142 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.