Page 1 of 1

How to call external page and how to place into specific loc

Posted: Wed Feb 01, 2012 11:05 pm
by premecorp
Hello Friends,
I have designed a page, it has header, footer, menus, left panel, right panel and body. Here I kept all in separate file and included with PHP include() function. And I need when I click any menu (I used hyperlink) the specific page should be open in the main body location. So my problem is how to call specific page by specific menu and how to place in main body page at specific location. In this case my main body page, menu page and external page all are different page. If anyone have good idea about this kindly help me.

Thanks & Regards,
Premashish

Re: How to call external page and how to place into specific

Posted: Thu Feb 02, 2012 3:17 am
by theserve
you will need to pass a variable to each page which dictates which body page to include

eg: http://www.domain.com?page=home

then in the script you can use a switch or if statement to include the page you want.

Code: Select all

if($_GET['page'] == "home")
{
include "home.php";
}
You should also consider using mod_rewrite to improve the search engine friendliness of the urls.