friedice Posted May 20, 2010 Share Posted May 20, 2010 i have 2 pages index.php and content.php in index.php there is a div class can i add content.php in the div class using templates in index.php? is this possible? Link to comment https://forums.phpfreaks.com/topic/202381-add-php-page-in-a-div-in-another-php-page/ Share on other sites More sharing options...
ale8oneboy Posted May 20, 2010 Share Posted May 20, 2010 Take a look at the include() function. It allows you to include one file in another file. http://php.net/manual/en/function.include.php In your index.php file you would have a line that says: <?php include("content.php"); ?> Link to comment https://forums.phpfreaks.com/topic/202381-add-php-page-in-a-div-in-another-php-page/#findComment-1061116 Share on other sites More sharing options...
gwolgamott Posted May 20, 2010 Share Posted May 20, 2010 Also here's a link to setup a dynamic page using a link to include different php scripts within a main template script. http://woork.blogspot.com/2007/10/load-page-using-url-variables-and-php.html Link to comment https://forums.phpfreaks.com/topic/202381-add-php-page-in-a-div-in-another-php-page/#findComment-1061129 Share on other sites More sharing options...
friedice Posted May 21, 2010 Author Share Posted May 21, 2010 yeh i noe bout dat but can u include it in the .tpl file since php is all seperated from the tpl file unless u use place holders? Link to comment https://forums.phpfreaks.com/topic/202381-add-php-page-in-a-div-in-another-php-page/#findComment-1061560 Share on other sites More sharing options...
BizLab Posted May 21, 2010 Share Posted May 21, 2010 Are you trying to create a type of frame? Take a look at the include() function. It allows you to include one file in another file. http://php.net/manual/en/function.include.php In your index.php file you would have a line that says: <?php include("content.php"); ?> I would use require('page.php'); instead of the include() function - just a note. Link to comment https://forums.phpfreaks.com/topic/202381-add-php-page-in-a-div-in-another-php-page/#findComment-1061564 Share on other sites More sharing options...
friedice Posted May 21, 2010 Author Share Posted May 21, 2010 well im tryin to add a photoalbum in dat div and since using PEAR templates u cant include php tags in tpl file Link to comment https://forums.phpfreaks.com/topic/202381-add-php-page-in-a-div-in-another-php-page/#findComment-1061576 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.