[Phpwm] Site Structure

Matt Harris mharrisweb at yahoo.co.uk
Fri Dec 9 10:58:02 GMT 2005


Hi Folks,
  
  Hope your all ok.
  
  I was after some basic advice, regarding setting up my site using php (this is my first php project).
  
  I have my index page with two divs, one for the menu and one for the  content where I pull in the different pages, by setting a variable  thats the name of the page, in the url. Below is the code I have in my  index.
  
  <?php
  if (isset($_GET['page'])) {
  $page = $page . "." . "php";
  include("$page");
  }
  else {
  include("welcome.php");
  }
  ?>
  
  This works fine, but if I want to redirect the user to a different page  using the header function, I get an error because there is html on my  index page, before the php code.
  
  How do you guys go about setting up your sites in a resourceful way?
  
  Am I just better off sticking to including a header and a footer on all my pages?
  
  Any advice would be much appreciated.
  
  Many thanks.
  
  Matt
  
		
---------------------------------
  Play Santa's Celebrity Xmas Party, an exclusive game from Yahoo! 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.lug.org.uk/pipermail/phpwm/attachments/20051209/fc61e0f6/attachment.html


More information about the Phpwm mailing list