Web Hosting Talk







View Full Version : [Problem] PHP not working, help please


antonym66
07-31-2005, 10:42 PM
Hey guys, I'm working on my first website that is going to use a full PHP navigation system and I'm having some problems. Remember im a php n00b so go easy on me ;)

The problem is only when the link in the menu is 2 (or more) words. When it is only 1 word like faculty or academics it shows up in the content area fine. But when the link in the menu is 2 words like Educational Philosophy then the content area shows up blank. Here is a bit of the code from different pages.

Index.php
// Academics
case 'Academics':
include('pages/Academics.php');
break;
// Board of Trustees
case 'Board_of_Trustees':
include('pages/Board.php');
break;
// Curriculum
case 'Curriculum':
include('pages/Curriculum.php');
break;
// Educational Philosophy
case 'Educational_Philosophy ':
include('pages/Philosophy.php');
break;

menu.php
<a href="?id=Academics">Academics</a><br>
<a href="?id=Board">Board_of_Trustees</a><br>
<a href="?id=Curriculum">Curriculum</a><br>
<a href="?id=Philosophy">Educational_Philosophy</a><br>
<a href="?id=Extra">Extra-Curricular</a><br>
<a href="?id=Faculty">Faculty</a><br>
<a href="?id=PTA">PTA</a><br>
<a href="?id=Life">Religious Life</a><br>
<a href="?id=directions">Directions to the School</a><br>
<a href="?id=contact">Contact Us</a></p>

Ive messed around with it but still cant get it too work. Can anyone tell me what I'm doing wrong please?

Oshaka
07-31-2005, 10:47 PM
It's because your links are not matching your get variables. for example .. case 'Educational_Philosophy ': is fine, but your href should be <a href="?id=Educational_Philosophy">Educational_Philosophy</a><br>

It has to match...



- Josh.

antonym66
07-31-2005, 11:05 PM
Yeah I just figured that out and came to post that I had it buy you were quicker than me ;) Thanks for the help though Josh I really would have needed it had I not accidently realized that everything has to match lol