Forum Moderators: coopster
and I want to include the footer for all the pages in the /dir/ folder
I tried adding a include e.g <?php include("includes/footer.php"); ?>
and it wont show up but when I view source from the browser i can see the include code on the page (<?php include("includes/footer.php"); ?>)
I thought that you cant see php code if you view source from the browser.
does that mean there is somthing else to do to use a php include?
thanks
thanks
and I am calling it from a folder e.g www.mysite.com/includes/footer.php
and I want the contents of footer.php to show up on my page which is in
www.mysite.com/dir/index.php
the thing is that the /dir/index.php page calls the layout of the page from the template.php page which I placed the include file in so that it would show up on the /dir/index.php page if i add the include directly to the /dir/index.php page it works.
any ideas?
$content_page_name .= '';
include "../../includes/page_name.inc.php";
$page->SetParameter("PAGE_NAME",$content_page_name );
and each includes (you will need to create yours)
might look like this:
$db = new MySQL_Db;
$db->connect($host, $un, $pw);
$db->query($db_db);
$result = $db->query("
SELECT main_content
FROM #*$!#*$!
WHERE
topic_id='$topic_id'
");
while($new_content= $db->fetch_array($result))
{
$content_main_content.= $new_content['main_content'];
}
only thing is that the include shows up on the page when put in the index file but not in the position that i want it. he didn't mention how to position it.
anyway thanks guys!