me1000 Posted October 17, 2006 Share Posted October 17, 2006 im using a template page, and the contents of the page is displayed using this code...[code]if ($page == "") { include("home.php"); } else { include($page.".php"); }[/code]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 lolbasically what happens is the URL is index.php?page=somethingbut if there is no var defined, then it includes home.php if it is defined then it includes whatever the var is..Thanks, Link to comment https://forums.phpfreaks.com/topic/24165-a-better-way/ Share on other sites More sharing options...
marcus Posted October 17, 2006 Share Posted October 17, 2006 [code]if ($page == false) { include("home.php"); } else { include($page.".php"); }[/code] Link to comment https://forums.phpfreaks.com/topic/24165-a-better-way/#findComment-109817 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.