Jump to content


Photo

A better way?


  • Please log in to reply
1 reply to this topic

#1 me1000

me1000
  • Members
  • PipPipPip
  • Advanced Member
  • 183 posts

Posted 17 October 2006 - 12:24 AM

im using a template page, and the contents of the page is displayed using this code...


if ($page == "") {
			include("home.php");
	
	} else {			
		include($page.".php");
	}


It works fine now, but i want to know if there is a better way to do it.
I know that what Im asking is very broad lol

basically what happens is the URL is index.php?page=something
but if there is no var defined, then it includes home.php if it is defined then it includes whatever the var is..

Thanks,

#2 marcus

marcus
  • Members
  • PipPipPip
  • Advanced Member
  • 1,842 posts
  • LocationRochester, NY

Posted 17 October 2006 - 12:26 AM

if ($page == false) {
			include("home.php");
	
	} else {			
		include($page.".php");
	}





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users