HTML Question

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
Post Reply
User avatar
Andrew_b




Socialist

Posts: 4188
Joined: Sat Feb 24, 2007 4:52 pm
Contact:

HTML Question

Post by Andrew_b »

Is it possible for an html file to use contents from another html file? I am asking this because i know my website is probably going to have about 30 + pages, and i dont feel like editing them all everytime i add a new page. So i was wondering, Is there a code like the following that will use contents from another html file.

Code: Select all

<!-- NAVIGATION STARTS HERE -->

  <table border="0" cellpadding="0"cellspacing="0" width="100%">
   <tbody>

    <link rel="contents" type="text/html" href="./links.html" />

   </tbody>
  </table>

<!-- NAVIGATION ENDS HERE -->
And the links.html would inclue this:

Code: Select all

<tr>
    <td class="navleft" width="2" height="0"></td>
    <td class="navmiddle" align="center"><a href="./index.html">Home</a></td>
    <td class="navright" width="2"></td></tr><tr>
    <td class="navleft" width="2" height="0"></td>
    <td class="navmiddle" align="center"><a href="./programs.html">Programs</a></td>
    <td class="navright" width="2"></td></tr><tr>
    <td class="navleft" width="2" height="0"></td>
    <td class="navmiddle" align="center"><a href="./information.html">Information</a></td>
    <td class="navright" width="2"></td></tr>
So then if all my pages were linked with links.html, I could edit all my links with this one file instead of editing all my pages.

So heres my question: Is this possible at all?
User avatar
FleetAdmiralBacon




Critic Pyre Articulatist 500

Posts: 2377
Joined: Sat Nov 26, 2005 7:01 pm
Location: Ohio
Contact:

Post by FleetAdmiralBacon »

Not directly.
You can use an iframe and load something else into it, but you can't import with just HTML.

But why are you using pure HTML? No one does pure HTML anymore.
Get yourself a scripting language. Go with one of the P's (PHP, Perl, Python). Tasks such as this are menial and quick in these tools.
Image
Everything you'll ever need to know about me.
Need help with Linux, C#, C, Python, Java, PHP, Javascript, CSS, or VB? I'm available from 3:00PM-8:00PM EST on weekdays.
User avatar
Andrew_b




Socialist

Posts: 4188
Joined: Sat Feb 24, 2007 4:52 pm
Contact:

Post by Andrew_b »

FleetAdmiralBacon wrote:Not directly.
You can use an iframe and load something else into it, but you can't import with just HTML.

But why are you using pure HTML? No one does pure HTML anymore.
Get yourself a scripting language. Go with one of the P's (PHP, Perl, Python). Tasks such as this are menial and quick in these tools.
They dont use HTML anymore. Wow.

Well what should i do to accomplish this?

How do i use iframes? im looking for tuts now.
User avatar
Tural




Conceptionist Acolyte Bloodhound Recreator
Socialist Connoisseur Droplet Scorched Earth
Grunge

Posts: 15628
Joined: Thu Jun 16, 2005 3:44 pm
Location: Lincoln, NE
Contact:

Post by Tural »

He's correct. No self-respecting web developer would use on HTML, it's just not practical for anything. With something such as PHP, it's one simple line [include('links.php');], but with HTML, you're going to have to use frames, and nobody likes frames. =/
User avatar
Andrew_b




Socialist

Posts: 4188
Joined: Sat Feb 24, 2007 4:52 pm
Contact:

Post by Andrew_b »

I can tell why no one likes frames. (I hate them just by working with them for 2 minutes.)

Well i guess i should move on. I think i will go with php since tural showed me its easy to work with. Thanks for the help everyone.
Post Reply