@mr.e van vorige pagina:
voor dit:
PHP:
if ($site == "home") {
include('home.inc');
} else if ($site == "poems") {
include('poems.inc');
} else if ($site == "gallery") {
include('gallery.inc');
} else if ($site == "contact") {
include('contact.inc');
} else if ($site == "poem1") {
include('poem1.inc');
} else if ($site == "poem2") {
include('poem2.inc');
} else if ($site == "pic1") {
include('pic1.inc');
} else if ($site == "bqpic") {
include('bqpic.inc');
} else if ($site == "pic2") {
include('pic2.inc');
//} else {
// include('404.inc');
}
zou ik de switch statement gebruiken.. is volgens mij ook sneller..
dus:
PHP:
SWITCH($site){
case home:
$page = home.inc;
Break;
case poems:
$page = poems.inc;
Break;
case gallery:
$page = gallery.inc;
Break;
Default:
$page = home.inc;
Break;
include ($page);
}