I was thinking about cleaning up my website and using PHP in the next build so I could make the site a little more dynamic, however I ran into a problem with this code:
<?php
if ($page == 'home') { include("includes/home.php"); }
elseif ($page == 'news') { include("includes/news.php"); }
elseif ($page == 'community') { include("includes/community.php"); }
elseif ($page == 'resources') { include("includes/resources.php"); }
elseif ($page == 'store') { include("includes/store.php"); }
elseif ($page == 'tos') { include("includes/tos.php"); }
elseif ($page == 'error') { include("includes/error.php"); }
else { echo "General error. You probably followed a bad link."; }
?>
When I get my site name in http://www.site.com/index.php?home
this comes up with my error " General error. You probably followed a bad link."
However if I use
[code]
<?php if ($page == NULL) { include("includes/intro.php"); } ?>[code]
and then the script, everything works just as it should
I’m not sure what the problem is here. Any help would be greatly appreciated
Thankyou,
Taylor