View Full Version : Need help with include!

07-07-2006, 06:20 PM
Someone prepared a menu for me using OpenCube and now I'm supposed to export the html and use it as an include on several pages. I have absolutely no experience with includes, can someone walk me through this process? Thanks, take care...

Creative Insanity
07-07-2006, 07:49 PM
if in differant folder
<?php include(location/page.php); ?>
if in same location
<?php include(page.php); ?>

07-08-2006, 10:11 PM
I was about to login to post basically the same question.
I have a block of code that implements a fancy, two-row nav bar.
And I have been copying it into every page on my site whenever I
change any aspect of the navigation. I'm assuming there's no
built-in way in Dreamweaver, to "include" this HTML code (the table
and all the nav buttons, imbedded javascripts etc) so that I can keep
and maintain the nav bar in one place, so that one update effects the
nav bar on every page.

If I saved my html code for the nav bar as a .php file, would the above
technique work? There is no php in my nav bar, but seems like it should
work anyway?

thanks in advance for any suggestions...


07-08-2006, 11:56 PM
apparently not... I save the header html code as a .php (and the footer),
setup two include statements in a test page, but no luck. Must be it
takes something else?...


07-09-2006, 07:13 AM
In case you look at my code... I disovered the DW "Library" function... sweet!
I had used DW Templates for the past few sites, but various problems. Library
items look like a much cleaner solution to this problem.

But, I would still like to learn how to call PHP from within my DW HTML pages,
I'm reading a basic PHP book, and would rather manage re-usable code elements
as PHP modules, so I could begin to introduce some PHP functionality into my sites.



Creative Insanity
07-09-2006, 07:19 PM
Yes the above include will work for a nav bar and footer.

<?php include(navbar.php); ?>

and when you get really up with php you can use in your html pages just