glow Posted January 17, 2012 Share Posted January 17, 2012 Hi I'm in a need of help here, I need to inluded this: "http://site.com/products.php?do=groups&groupid=2" in a a tpl file. Any way that this can be done? an example would be greatly appreciate it. cheers Quote Link to comment https://forums.phpfreaks.com/topic/255201-php-include-in-a-tpl-file-question/ Share on other sites More sharing options...
trq Posted January 17, 2012 Share Posted January 17, 2012 Your question makes little sense. The .tpl extension is not generally related to php. We are going to need more details. Quote Link to comment https://forums.phpfreaks.com/topic/255201-php-include-in-a-tpl-file-question/#findComment-1308486 Share on other sites More sharing options...
glow Posted January 17, 2012 Author Share Posted January 17, 2012 Ok let me further explain, currently my index file calls a .ptl file at opening like this: define( "MAINAREA", FALSE ); require( "dbconnect.php" ); require( "includes/functions.php" ); require( "includes/clientareafunctions.php" ); $pagetitle = $_LANG['globalsystemname']; $breadcrumbnav = "<a href=\"index.php\">".$_LANG['globalsystemname']."</a>"; $templatefile = "content"; $pageicon = ""; initialiseClientArea( $pagetitle, $pageicon, $breadcrumbnav ); $result = select_query( "tblannouncements", "", array( "published" => "on" ), "date", "DESC", "0,3" ); while ( $data = mysql_fetch_array( $result ) ) { $id = $data['id']; $date = $data['date']; $title = $data['title']; $announcement = $data['announcement']; $result2 = select_query( "tblannouncements", "", array( "parentid" => $id, "language" => $_SESSION['Language'] ) ); $data = mysql_fetch_array( $result2 ); if ( $data['title'] ) { $title = $data['title']; } if ( $data['announcement'] ) { $announcement = $data['announcement']; } $date = fromMySQLDate( $date ); $announcements[] = array( "id" => $id, "date" => $date, "title" => $title, "urlfriendlytitle" => getModRewriteFriendlyString( $title ), "text" => $announcement ); } $smartyvalues['announcements'] = $announcements; $smartyvalues['seofriendlyurls'] = $CONFIG['SEOFriendlyUrls']; outputMAINtArea( $templatefile ); ?> the ("$templatefile = "content" line does the .tpl file loading which is fine the only problem is thatinstead of that "content" tpl file i need it to load this php file: /products.php?do=groups&groupid=2. So i figure if somehow I can get this php file to be included within the tpl file I could get it loading through there, unless there is a much direct way. thank you Quote Link to comment https://forums.phpfreaks.com/topic/255201-php-include-in-a-tpl-file-question/#findComment-1308562 Share on other sites More sharing options...
trq Posted January 17, 2012 Share Posted January 17, 2012 Including a file via a url is not the same as including a file directly. You will only receive the output from the file, not the variables, classes and all the good stuff. Quote Link to comment https://forums.phpfreaks.com/topic/255201-php-include-in-a-tpl-file-question/#findComment-1308683 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.