Jump to content

A better way?


me1000

Recommended Posts

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 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,
Link to comment
https://forums.phpfreaks.com/topic/24165-a-better-way/
Share on other sites

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.