PDA

View Full Version : PHP for loading external HTML file inside of <div> ?


FethrdWlf
02-01-2011, 01:10 AM
Yes, I'm back again, and ready for a new answer to my new problem/idea! I have a website comprised of several different pages:

•index.html
•progress.html
•contact.html
•media.html
•" "pictures.html
•" "videos.html

Each one is it's own separate thing. But, I would like to connect them in a way by creating a sidebar that is identical in each one. It should contain the same information as the next and previous pages' do. So, I thought it would be cool to just create another HTML file called sidebar.html, and then load it inside of a <div> tag near the right side of my screen. How could I do that? I know that it's possible with PHP (right?), which is how I would prefer doing it.

edbr
02-01-2011, 01:34 AM
php includes.
theres a tutorial in the tutorial (you guessed it) section

FethrdWlf
02-01-2011, 01:35 AM
php includes.
theres a tutorial in the tutorial (you guessed it) section

I'll check it out, but I think I might have figured it out using an i-frame. Are there any drawbacks to i-frames over your solution?

edbr
02-01-2011, 01:42 AM
<?php include('style/sidebar.txt'); ?> whats simoler tha that. an i frame loads an external web page, this just incudes the text/code

Corrosive
02-01-2011, 08:27 AM
Don't use iframes. use includes; http://www.dreamweaverclub.com/php-includes.php

domedia
02-01-2011, 12:45 PM
But, I would like to connect them in a way by creating a sidebar that is identical in each one. It should contain the same information as the next and previous pages' do. So, I thought it would be cool to just create another HTML file called sidebar.html, and then load it inside of a <div> tag near the right side of my screen. How could I do that?
You don't. 8)

Almost every website you see out there has a consistent design, with a consistent navigation area. Just build a regular web page. You're trying to reinvent the wheel.