Page 1 of 1

Help with multipage layout

Posted: Sat Aug 18, 2007 11:05 am
by gurn
Hello, I'm a bit of a nooble at php and am desperatly looking for some help.

Okay what i am basically trying to do is have 2 div's (or tables) 1 for a sub menu and the other for the content. In the content i want to be able to load 2 different tpl(or php) files for example we'll call them page1 & page2.

Page1 would be the default page shown upon visiting the site, but i would like this page to be dumped and page 2 shown in it's place in the event of a user selecting page 2 in the menu (and of course the menu to be able to call page1 back).

Here's what i came up with, but the menu calls the page for the whole browser not just in the "content div"

Code: Select all

$page = $_GET['p']; 
if (($page == "1") or ($page =="")) { include('../templates/1.tpl'); 
} else if($page == "2") { include('../templates/2.tpl');
}
Thank you for reading my post, i hope you can possibly help me.

Re: Help with multipage layout

Posted: Sat Aug 18, 2007 11:20 am
by superdezign
You can't actually change just one part of the site without doing it as you are. Maybe you want frames or something.

Posted: Sat Aug 18, 2007 11:44 am
by gurn
Ah thank you for confirming that for me.

Posted: Sat Aug 18, 2007 11:46 am
by superdezign
gurn wrote:Ah thank you for confirming that for me.
Be forewarned... Frames are annoying and becoming deprecated. I'd redesign before I used frames.

Posted: Sat Aug 18, 2007 11:56 am
by gurn
Ah no worries i had no intention of using frames, i hate frames too. i only wanted to add pages loading in the same main page because i diden't want to add a sub menu each page, see it's a lyrics page and there are 35 pages to make (just being lazy :oops: ).

Thanks once again.

Posted: Sat Aug 18, 2007 11:59 am
by superdezign
Just submenus? Have you considered JavaScript, then?

Posted: Sat Aug 18, 2007 12:05 pm
by gurn
Isn't java abit slow?