[SOLVED]Trouble understanding a website structure

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
IanMartins
Forum Newbie
Posts: 2
Joined: Sat Jun 28, 2008 9:35 am

[SOLVED]Trouble understanding a website structure

Post 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
User avatar
Jasheppard
Forum Newbie
Posts: 24
Joined: Tue Jun 17, 2008 11:44 pm

Re: Trouble understanding a website structure

Post 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... ???
jamesm6162
Forum Newbie
Posts: 13
Joined: Sat Jun 28, 2008 10:31 am

Re: Trouble understanding a website structure

Post 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?
IanMartins
Forum Newbie
Posts: 2
Joined: Sat Jun 28, 2008 9:35 am

Re: Trouble understanding a website structure

Post by IanMartins »

The syntax error in the navscript was the root of the problem -- thank you. :)
User avatar
Jasheppard
Forum Newbie
Posts: 24
Joined: Tue Jun 17, 2008 11:44 pm

Re: [SOLVED]Trouble understanding a website structure

Post by Jasheppard »

lol thought something looked odd about that :P
Post Reply