Forum Moderators: mack
I am new to this board and it seems like a great place so far. I am not a total newbie, but I am new when it comes to some of the newer technologies.
One of the sites I am currently developing will have a few basic static web pages. It will also have a few PHP scripts that I am using that were made available from my hosting company. (a calendar and image gallery)
I have read a lot about frames on this site and I am not sure I want to use them. I know that with frames, I can keep my menu on the left and just have the php pages run in the main frame.
My concern is to try to give the scripts a somewhat common look and feel as the rest of the website without having to completly re-write the PHP scripts since I don't know much about PHP.
Is there any way to replicate this without using frames?
I am currently using FP 2003 and I am evaluating Dreamweaver MX 2004.
Any help would be greatly appreciated.
If you're using PHP already, then you can use PHP's "include function" to have a consistent menu etc. on each page. It looks something like this:
<?php include($_SERVER["DOCUMENT_ROOT"]."/includes/menu.inc.php");?> You put the fragment of HTML which has your menu, and then you include it on each page. That means that if you want to change the menu, you only alter one file and the whole site is updated.
Whatever you do, don't go down the frames route - they introduce far too many problems in terms of web site usability, accessibility, etc.
Can I include a PHP page into a htm page or vice versa? I thought they had to be the same?
For example, my left navigation menu was going to me an htm file (not php) as is most of the content of the website. However, a couple functions of the website (Calender and gallery) are all PHP files.
I have also been reading about in-line frames... Do they have the same problems are regular frames?
Thanks for your help!
As for using the include, you need to place the fragment of your HTML which relates to your menu into a separate file (without the <body>, <head> etc. tags), then you place the include code in all your main pages at the place you would like the menu to appear. Your files will need to have a .php extension, or you will need to make your .htm files parsed for PHP.