iRloading Posted December 9, 2007 Share Posted December 9, 2007 ok, trying to make a website using switch statements to change the contents~ switch problem so everything is accounted for, header, footer, content.php using content.php as placeholder for the "content" which is supposed to change when you click on a link so my content.php: <?php echo $page; ?> and in my index.php: $page = $_GET['page']; switch($page){ case '1': $page = '/1.php'; break; with 1.php supposedly being what's supposed to be inside the "contents" but instead of displaying the contents of 1.php inside the contents of the website, it simply displays "1.php" sorry if I sound confusing, since using php is confusing for me~ so summary: clicking on link should change the "contents" into the contents of "1.php" but what's happening is it's displaying the text "1.php" in the "contents" box like it was echo Link to comment Share on other sites More sharing options...
Statutory Ray Posted December 9, 2007 Share Posted December 9, 2007 Make "$page = '/1.php'" into "$page = include('/1.php');" maybe? Link to comment Share on other sites More sharing options...
iRloading Posted December 9, 2007 Author Share Posted December 9, 2007 aha, thanks~ seems I was going about it the wrong way, I didnt need to have a contents.php for the contents of 1.php to be called into I could just call 1.php directly into the scene in itself so now it's: switch($page){ case '1': $page = include('1.php'); break; thanks man Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now