Jump to content

Confused about how lay it out?


dmccabe

Recommended Posts

I am having an attempt at making a small intranet for my work.

 

I have got myself confused about how to best display the content.

 

I have a header.php with the main header image and menu, then I want it so when they click "Call Centre Dept" the main header stays, but the main content changes to that page, however each dept with have it's own index.php and it's own sub pages.

 

Set out like this:

/header.php

/index.php

/dbconnect.php

/footer.php

/callcentre/index.php

/callcentre/page1.php

 

Is the best way of keeping the header the same by using include('header.php') at the top of each new page?  if so when I get to the /callcentre/index.php how do I call the header.php ? as if I use include('header.php') wont be now looking in /callcentre/ for the header.php instead of the root dir?

 

 

Link to comment
https://forums.phpfreaks.com/topic/98310-confused-about-how-lay-it-out/
Share on other sites

Excellent thanks WildTeen, i knew I could just put the full path in but didnt want to do this as I know it is not good code.

 

I think the document_root is what I was after :)

 

 

Ok one more question at the beginning of my header I have:

 

$title = "Intranet";

 

Then in the header:

 

<title><? echo $title ?></title>

 

Now say in the call centre page I want to put:

 

$title = $title." - Call Centre"

 

So that the title of the page becomes "Intranet - Call Centre"

 

How can I do it if the title is set in the header ? that would mean that setting the variable in the call centre page would have no affect.

Unless header.php is included after you set the $title varable in the call center page then header.php will set the title to

<title>Intranet - Call Centre</title>

 

If header.php is set before then header.php will not retrieve the new updated title variable. PHP does not backtrack.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.