Page 1 of 1

[SOLVED]Trouble understanding a website structure

Posted: Sat Jun 28, 2008 10:06 am
by IanMartins
I'm attempting to learn how to use a new website structure, and would appreciate any advice.

index.php has four div parts: banner, navigator, footer and content. The first three should be constant, while the content div should change according to what the user selects on the navigator.

If a user selects "contact us" on the navigator, the URL should become "http://www.mysite/index?menuId=contact".
If a user selects "guestbook" on the navigator, the URL should become "http://www.mysite/index?menuId=guestbook".
Etc...

When I load the website as it currently is, the banner, navigator and footer loads, but the content remains empty no matter what I select on the navigator -- and the URL changes to "?menuId=contact" rather than "index?menuId=contact".

Here's the three relevant scripts that I'm using -- I've made them very short and simple to look over:

index.php:
http://pastebin.com/m58891dfe

navscript.php:
http://pastebin.com/m647e051b

navigator.php:
http://pastebin.com/m738bec3d

Any advice would be greatly appreciated. :-)

P.S. This site operates exactly the way that I'm attempting to understand:
http://www.episteme.no/index.php?categoryid=1

Re: Trouble understanding a website structure

Posted: Sat Jun 28, 2008 11:09 am
by Jasheppard
my site uses this navigation (very useful), with it including the php files needed.

your using index without the extension?
changes to "?menuId=contact" rather than "index?menuId=contact".
index?menuId=contact this only works if index is a folder, but ?menuId=contact works cause the default page is already index.php.

And about the content... try the require's out of the functions... or instead of using require(), use include()
if it doesn't work? then... ???

Re: Trouble understanding a website structure

Posted: Sat Jun 28, 2008 11:34 am
by jamesm6162
Okay perhaps a syntax error in navscript.php:
?_GET['menuId'];
require("frontpage.php");
Are you sure the php pages that you include (e.g. frontpage.php) in your content actually echo the html text?

Re: Trouble understanding a website structure

Posted: Sat Jun 28, 2008 1:47 pm
by IanMartins
The syntax error in the navscript was the root of the problem -- thank you. :)

Re: [SOLVED]Trouble understanding a website structure

Posted: Sun Jun 29, 2008 1:01 am
by Jasheppard
lol thought something looked odd about that :P