html 'Frame like' page in php

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
mayajewe
Forum Newbie
Posts: 13
Joined: Sun Feb 01, 2009 12:56 pm

html 'Frame like' page in php

Post by mayajewe »

Hi,

I would like to create a page that has a left navigation menu, a top header area and an area for the main text. I know this can be done using html Frames but I have read that "frames are evil!" :D

I have looked at using php templates and have got it working so that text from a file displays in main frame. I have also tried using echo file_get_contents() and having another php file with content in that has a variable it passes to the template handler. The problem is, these both just get the data as a string. I want to display an actual working php file that I want to use for admin purposes within the "main area". I have several seperate php pages that do things like upload a file upload.php and editpagecontent.php (which allows content to be added to a database). This is for an admin only part of a website, it won't be for general puplic viewing if that makes any difference. I just want one page where I can access and use all the admin pages.

Can anyone point me in the right direction? I just want to have the php pages I already have working, displayed with the left navigation menu and top header. Thank you.

I hope this makes sense!
mickeyunderscore
Forum Contributor
Posts: 129
Joined: Sat Jan 31, 2009 9:00 am
Location: UK

Re: html 'Frame like' page in php

Post by mickeyunderscore »

I think you may be looking for the include() / require() functions.

http://uk.php.net/include/

PS, frames are evil because they are bad for accessibility
mayajewe
Forum Newbie
Posts: 13
Joined: Sun Feb 01, 2009 12:56 pm

Re: html 'Frame like' page in php

Post by mayajewe »

Thanks for that it works perfectly and such a simple thing. :D I only started using php last week I just didn't know what it was.

I used to use frames when I first started to learn html and now I am doing my best to learn css. I know what a pain frames are and that "real" programmers don't like them. I want to learn to make user friendly website and I appreciate that accessibility is so important. Thanks again for the help, I think that these php templates are going to be very useful.
Post Reply