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

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
premecorp
Forum Newbie
Posts: 15
Joined: Fri Nov 04, 2011 9:12 am

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

Post 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
User avatar
theserve
Forum Newbie
Posts: 24
Joined: Wed Jan 18, 2012 6:35 am
Location: London

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

Post 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.
Post Reply