Jump to content


PHP Navigation TWICE


2 replies to this topic

#1 Sh0ck

    Young Padawan

  • Members
  • Pip
  • 9 posts
  • Gender:Male

Posted 09 September 2007 - 09:28 AM

Okay so I am making a website for my cousin's daycare and I have a php navigation include set up cuz i got sick of using iframes.

It works fine but there is a page for the rooms and I want it to display the same kind of navigation

index.php?page=rooms?name=ROOMNAME

INDEX.php
*code for the include
<?php
switch ($HTTP_GET_VARS[page]) {
//Default - case
default:
include "content.html";
break;

//ABOUT US - case
case 'aboutus':
include 'about.htm';
break;

//RATES - case
case 'rates':
include 'rates.html';
break;

//ROOMS - case
case 'rooms':
include 'rooms.php';
break;

//NEWSLETTER - case
case 'newsletter':
include 'news.php';
break;

//STAFF - case
case 'staff':
include 'staff.html';
break;

//FORMS - case
case 'forms':
include 'forms.htm';
break;

//CONTACT - case
case 'contact':
include 'contact.html';
break;
}?>

ROOMS.php
*code for the include
<?php
switch ($HTTP_GET_VARS[name]) {
//Default - case
default:
include "rooms_default.html";
break;

//Dinosaur Room - case
case 'dinosaur':
include 'Dino.htm';
break;

//Library Room - case
case 'library':
include 'Library.html';
break;

//Ocean Room - case
case 'ocean':
include 'Ocean.htm';
break;

//Pony Room - case
case 'pony':
include 'Pony.htm';
break;

//Solar Room - case
case 'solar':
include 'Solar.htm';
break;

//Tomato Room- case
case 'tomato':
include 'Tomato.htm';
break;

//Tiger Room - case
case 'tiger':
include 'Tiger.html';
break;

//Tree Room - case
case 'tree':
include 'Tree.htm';
break;

//Zebra Room - case
case 'zebra':
include 'Zebra.html';
break;

//Zoo Room - case
case 'zoo':
include 'Zoo.html';
break;
}
?>

ROOMS PAGE

#2 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 970 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 09 September 2007 - 12:03 PM

Basics of HTML. Separate your variable names with the ampersand (&amp;).

index.php?page=rooms&name=ROOMNAME

Then proceed to grab the variables through the $_GET superglobal array ($HTTP_GET_VARS is depreciated I hope you know).

#3 Sh0ck

    Young Padawan

  • Members
  • Pip
  • 9 posts
  • Gender:Male

Posted 09 September 2007 - 12:39 PM

woops lol thanks and i got the code from a friend.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users