mrwilson Posted October 24, 2006 Share Posted October 24, 2006 Hello. This has to be so easy its embarrasing. I am trying to follow this example here [url=http://www.alistapart.com/stories/phpcms/]http://www.alistapart.com/stories/phpcms/[/url], the Swtching content with PHP variables section.I have followed the instructions on that page and have created the pages required. (very VERY simple pages).I have created the body and menu sections as required and changed the body include to <div class="body"><?php @ require_once ("$page.php"); ?></div>I then created the menus as shown on the link above as in below.<a href="template.php?page=dogs">The Dog page</a><br /><a href="template.php?page=cats">The cat page</a>When I put it all together, absolutly nothing happens except the URL address above changes and shows that I am now on either the cat or dog page. My question is, is there something I need to include in the code on the $page.php page to give the switch a place to reside? According to the example, the whole page should be replaced. Or am I misunderstanding the whole concept?The trial page I have made is here. [url=http://lunarcafe.com/tryme/template.php]http://lunarcafe.com/tryme/template.php[/url]Than you for taking the time to read this. After reading the code you guys are dealing with I am almost embarrased to post this. My server does have PHP on it, I have several other PHP pages that work fine. I just dont know how to use this type of switching. Quote Link to comment Share on other sites More sharing options...
kirk112 Posted October 24, 2006 Share Posted October 24, 2006 try<div class="body"><?php $page = $_GET['page'];@ require_once ("$page.php"); ?></div> Quote Link to comment Share on other sites More sharing options...
mrwilson Posted October 24, 2006 Author Share Posted October 24, 2006 Of course!Thank you so much for your time. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.