PDA

View Full Version : How to use PHP Include


tomh2010
04-20-2010, 04:36 PM
how can you load content of url to be content of div?

Corrosive
04-20-2010, 05:12 PM
Are you talking about using includes to import just content or a whole website shown inside a div?

DWcourse
04-20-2010, 05:16 PM
If you have created the page as a .php file then, in the Common tab of the Insert palette, click the Server-Side Include icon and locate the file you want to place. In the code it will look something like:

<?php virtual('path-to-file'); ?>

Depending upon the file type Dreamweaver may only show a PHP icon rather than the content.

You don't want to load an html file since you'll be adding additional head, body, etc. info and tags.

Although you can load "chunks" of html in a .txt file and DW will display it.

Better PHP support is supposed to be one of the big improvements coming in CS5.

tomh2010
04-20-2010, 05:44 PM
Are you talking about using includes to import just content or a whole website shown inside a div?

whole web content

I am trying to load a full page of content from an external link into a div.
I have about 7 external linked pages that I would like to have in a navigation bar.
Each link button would load a full webpage of content in the same div.

Corrosive
04-20-2010, 05:58 PM
Maybe look at iframes for this then; http://www.htmlcodetutorial.com/frames/_IFRAME.html

tomh2010
04-20-2010, 06:12 PM
Maybe look at iframes for this then; http://www.htmlcodetutorial.com/frames/_IFRAME.html


That would be good, but does not work in my browser I E 8

I did get it to work with frames, except when you try to load a second navigaition button choice it opens a new window. It would only works the first time you make a choice.

Corrosive
04-20-2010, 06:26 PM
Maybe try a pure frames built site then. W3 Schools should have a guide on there I'd have thought. Why are you trying to do this anyway?

DWcourse
04-20-2010, 06:38 PM
Each "window" in a frame can be named and then your links can target the window you want the link to open in.

tomh2010
04-20-2010, 07:58 PM
Each "window" in a frame can be named and then your links can target the window you want the link to open in.

Just a temporary thing, need more complex asp / php to site to intergate idx technoogy