TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 19, 2024, 10:32:36 PM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,195
  • Total Topics: 21,220
  • Online today: 128
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 38
  • Total: 38

XML/HTML pulls

Started by Raven, February 10, 2007, 10:06:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Raven

Sorry if this is in the wrong place...

Anyway! You know the &include thing that you can use with php to pull an external file?

Well I want to do that on a website I'm making. But not with PHP. Instead of editing every page I would like to include a HTML or XML file from an external source. Anything that will support standard HTML information (just a table with writing and images in it.)

So you have the page, and in a seperate block if you will, you pull HTML information from another file.

Pretty simple but I'm only decent with the basics. And I haven't tried this before.

Thanks.
  -Raven

IchBin

Don't think HTML all by itself has anything like that.

Raven

#2
Nevermind :) Dreamweaver saves again :)

Sorry for wasteing space. I always do that.. Post and then figure it out...

IchBin

Well since I can't read your mind and show you what you want me to do with that code I'll give you some info that I'll think will help you.

You can create a HTML and convert it to PHP VERY easily. Say you have an index.html file and you want to call that code in the boxes you posted above into that file. Lets call the first code snippet table.html and the second code image.html.

Basically what you're going to be doing is converting your HTML page into a PHP page.

This is a sample file of how you would do this:


<html>
<head>
<title>Your site.com</title>
</head>
<body>
All your content on the page goes in here.
Now lets include your files via php.
<?php
include('table.html');
?>

More HTML can go outside of these php tags.
Now lets add the other file
<?php 
include('image.html');
?>

</body>
</html>


Now that you've added PHP to your HTML file the only thing you have to do is rename index.html to index.php since it has php in it. :)

Raven

Ah you posted whilst I edited. My bad buddy. Javascript got it nicely. Just pulled a html file with the info in it :)

Raven

#5
Damn... Looking it over, it won't work, it shows in Dreamweaver but is ignored in browsers.

Turns out it was SSI too by the way.
I used
<!--#include file="latestnews.html" -->

I tried what you said ItchBin and it works great.
Thanks alot.

Sorry for the double post.
How strange. It works when its uploaded but not from HD.

Does it work for you? http://www.ravenmod.com/newsite/index.php
Your looking at the Nav bar, Llatest news and Affiliates blocks.