Im new to Tek-Tips and I've searched all day to make something very simple work but just cant seem to get it.
I need to set a default variable in case one is not supplied in the url. In coldfusion I could set it as <cfparam name="url.page" default="home">
than I need to have a if/else statement to load proper page depending on what that variable is set to.
This is my code so far but it is not working, can someone please help
<?php
$page = $_POST['page'] ;
if ($page=="home")
include("components/home.html");
elseif ($page=="about")
include("components/about.html");
elseif ($page=="locations")
include("components/locations.html");
elseif ($page=="models")
include("components/models.html");
elseif ($page=="community")
include("components/community.html");
elseif ($page=="contact")
include("components/contact.html");
elseif ($page=="hunter")
include("components/hunter.html");
elseif ($page=="benjamin")
include("components/benjamin.html");
elseif ($page=="michael")
include("components/michael.html");
elseif ($page=="abbey")
include("components/abbey.html");
?>
I need to set a default variable in case one is not supplied in the url. In coldfusion I could set it as <cfparam name="url.page" default="home">
than I need to have a if/else statement to load proper page depending on what that variable is set to.
This is my code so far but it is not working, can someone please help
<?php
$page = $_POST['page'] ;
if ($page=="home")
include("components/home.html");
elseif ($page=="about")
include("components/about.html");
elseif ($page=="locations")
include("components/locations.html");
elseif ($page=="models")
include("components/models.html");
elseif ($page=="community")
include("components/community.html");
elseif ($page=="contact")
include("components/contact.html");
elseif ($page=="hunter")
include("components/hunter.html");
elseif ($page=="benjamin")
include("components/benjamin.html");
elseif ($page=="michael")
include("components/michael.html");
elseif ($page=="abbey")
include("components/abbey.html");
?>