Jump to content


Photo

Simple Link Question


  • Please log in to reply
2 replies to this topic

#1 mrwilson

mrwilson
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 24 October 2006 - 11:05 PM

Hello.  This has to be so easy its embarrasing. 
I am trying to follow this example here http://www.alistapar...stories/phpcms/, 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.  http://lunarcafe.com...me/template.php

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.

#2 kirk112

kirk112
  • Members
  • PipPipPip
  • Advanced Member
  • 98 posts
  • LocationEngland

Posted 24 October 2006 - 11:09 PM

try

<div class="body">
<?php
$page = $_GET['page'];
@ require_once ("$page.php");
?>
</div>


#3 mrwilson

mrwilson
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 24 October 2006 - 11:19 PM

Of course!
Thank you so much for your time.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users