Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 18-04-2009, 06:30 PM   #1 (permalink)
Apprentice
 
Join Date: Jul 2007
Posts: 59
Default php master page help


I have start learning php recently and now I am creating a website for my friends project and the basic problem I faced is that php doesnot have masterpage option so how can I reflect menu and heder and footer in all those pages please help.
meghraj is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 19-04-2009, 12:20 AM   #2 (permalink)
spice it up
 
kapsicum's Avatar
 
Join Date: Apr 2004
Location: mumbai
Posts: 106
Default Re: php master page help

php is not so sophisticated like may be dotNet whic gven u the easy facility of master page ... but you can do it in similar way haveing index.php kindda page ... where you have your static pages like Header, Menu & Footer while leaving a section of Middle pages which are dynamic based on the parameters or query string u set in the browser URL ...
basically u can have a switch case for middle section which decides what page to include in the middle section based on a single variable set by you in the URL.. like
www.yourdomain.com/index.php?pg=home
OR
www.yourdomain.com/index.php?pg=contact
OR
www.yourdomain.com/index.php?pg=faq
and so on ...
where u are using the variable $_GET['pg'] in switch case to include the respective middle pages....
this is very common way to implement a master page kind of in php...

Let me know if you need more clarifications...
kapsicum is offline  
Old 19-04-2009, 12:28 AM   #3 (permalink)
Davislav Ivanuiz!!!
 
Kl@w-24's Avatar
 
Join Date: Apr 2004
Location: Pune
Posts: 1,396
Default Re: php master page help

Use CSS.
__________________
I was here when the forum's swear filter kept bleeping out the word 'FUNK'. :crazy::censored::eeksign:

www.abhi247.com | The Photohblog A Little Lunacy! [v3]

Flickr!
Kl@w-24 is online now  
Old 19-04-2009, 12:53 PM   #4 (permalink)
Right Off the Assembly Line
 
Join Date: Mar 2009
Posts: 12
Default Re: php master page help

you could create three different php files for menu,header and footer and include it wherever you need it.
__________________
http://geekztips.blogspot.com
nasweef is offline  
Old 20-04-2009, 01:39 PM   #5 (permalink)
Apprentice
 
Join Date: Jul 2007
Posts: 59
Default Re: php master page help

Quote:
Originally Posted by kapsicum View Post
php is not so sophisticated like may be dotNet whic gven u the easy facility of master page ... but you can do it in similar way haveing index.php kindda page ... where you have your static pages like Header, Menu & Footer while leaving a section of Middle pages which are dynamic based on the parameters or query string u set in the browser URL ...
basically u can have a switch case for middle section which decides what page to include in the middle section based on a single variable set by you in the URL.. like
www.yourdomain.com/index.php?pg=home
OR
www.yourdomain.com/index.php?pg=contact
OR
www.yourdomain.com/index.php?pg=faq
and so on ...
where u are using the variable $_GET['pg'] in switch case to include the respective middle pages....
this is very common way to implement a master page kind of in php...

Let me know if you need more clarifications...
I thanks for giving me such detail about it but can you please provide tutorial for this...for better understanding.
meghraj is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by Sujeet
- by gforz
- by soumya

Advertisement




All times are GMT +5.5. The time now is 03:12 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2