View Full Version : External document viewed within div or something similar.

Nov 18th, 2006, 03:11 AM
Site address: http://www.thatspoppycock.com

The simple way: If you look along the left-hand side underneath the titlebar and buttons, you will see a box w/ a picture as the heading, reading "Featured Articles." I want to make this box so that it gets its information from an external file, so that it can be displayed uniformly throughout the site.

More advanced: I'd like to have a more advanced way of updating this if at all possible. I'd like to be able to goto a certain hidden webpage on my server, enter a password, and enter link information so I don't have to go into Dreamweaver and enter all my information every single time; after entering the information, I'd like it to appear how it does now under the "Featured Articles" heading. I really want to implement a "favorites" box with the most popular links throughout the site, on every page.



The Iconoclast
Nov 18th, 2006, 03:28 AM
This isn't possible with HTML and CSS alone, I don't think so. You'd have to use a PHP include (http://www.albinoblacksheep.com/tutorial/include). It's not too hard, but your server has to have PHP enabled.

The biggest challenge with the login-to-update idea is security. You'd have to learn a lot of stuff to make sure that only you can edit the file- or use a prebuilt CMS. I'd go for the latter, unless you're a pretty experienced programmer.

EDIT: Please don't post the same thread (http://www.codingforums.com/showthread.php?p=506250) in multiple forums. I'm new here too, but I believe it's against the rules in most forums.

Nov 18th, 2006, 03:32 AM
Any idea where I can find this preprogrammed? It seems like a commonality, but I wouldn't know where to look or what to search for.

Nov 18th, 2006, 03:54 AM
EDIT: Please don't post the same thread (http://www.codingforums.com/showthread.php?p=506250) in multiple forums. I'm new here too, but I believe it's against the rules in most forums.

I wasn't sure which forum it belonged in... which does it belong in? I'll delete one of them.

Nov 18th, 2006, 09:21 PM
If your server does support PHP then save your pages with the .php extension and put whatever you want to appear in the div in it's own page labelled something.inc. Make sure you JUST put the bit you want to appear in your page and no other HTML or CSS.

E.G, your include file will have:

I want this to appear in my page.

And this.

And this.

and that is the extent of that include file!

Then on the page(s) you want it to display on, where you want it to show up type <? require 'something.inc' ?> and it will draw whatever you have in the include file to your page.

This way is great for things like footer that appear on all your pages because it means you only have to edit ONE page to change links and things sitewide.