Jump to content

Archived

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

me1000

A better way?

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,

Share this post


Link to post
Share on other sites
[code]
if ($page == false) {
include("home.php");

} else {
include($page.".php");
}
[/code]

Share this post


Link to post
Share on other sites

×

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.