SSI ~ Server Side Includes

  • Frostbyt3
  • Graduate
  • Graduate
  • User avatar
  • Posts: 221
  • Loc: Corpus Christi, TX

Post 3+ Months Ago

Ok i've used these somtimes but i was wondering, if there is some text on a certain site like in a table of data. Is there a way I can use some kind of SSI to put that text into my site. And when they update it, It would update on my site.

If you dont get what im saying ill try to be more specific.

Table of Data on somones site
Data1 - Words
Data2 - Words
Data3 - Words

and on my Site, I want to include ONLY "data2 - words" on my site, what kind of script would I use?

Normally it would be <!--#include file="filename.extension"--> but I dont know what I would do if I only wanted one piece of information.

and im sure I've seen this done before.

If you can help? Thanks. :)

- Frostbyt3
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Frostbyt3
  • Graduate
  • Graduate
  • User avatar
  • Posts: 221
  • Loc: Corpus Christi, TX

Post 3+ Months Ago

im assuming no one knows? :|
  • Carnix
  • Guru
  • Guru
  • User avatar
  • Posts: 1098

Post 3+ Months Ago

Can you use ASP or PHP for the include? If not, can you pre-process it through a CGI app first?

If the include is nothing but flat plain text and can't be processed by the server, other than to push the include file's contents out, then no, you can't do what you're asking.

If you use a server-side scripting language (PHP, ASP, CF, JSP... take your pick), you can do what your saying very easily.


.c
  • Frostbyt3
  • Graduate
  • Graduate
  • User avatar
  • Posts: 221
  • Loc: Corpus Christi, TX

Post 3+ Months Ago

Is it possible to put some PHP in HTML?
  • Managedlinks
  • Proficient
  • Proficient
  • Managedlinks
  • Posts: 294

Post 3+ Months Ago

it is possible to get get the server to parse html like it is php. but it will do that to all the html on your site.

one way of doing this is here...
http://www.managedlinks.com/htaccess.html

You will still need to write the php that extracts the information you want from the remote server.
  • Frostbyt3
  • Graduate
  • Graduate
  • User avatar
  • Posts: 221
  • Loc: Corpus Christi, TX

Post 3+ Months Ago

well the thing is i dont know php

i was wondering if there was a script on the internet somwhere that i could use to do this
  • Managedlinks
  • Proficient
  • Proficient
  • Managedlinks
  • Posts: 294

Post 3+ Months Ago

I don't know of any script you could simply plug in using SSI

I do something very similar, in that I have a script that loads the new york stock exchange exchange rates every day.

it gets the information and saves it to a file on my server

I can then include that information on any page I want using SSI

If thats the sort of thing you want you need to be able to create a script that can understand the web page it is getting the data from, otherwise it won't reliably return the information and if the page changes you have to be prepared for it.

What I am saying is it sounds like you need a custom solution.
  • Carnix
  • Guru
  • Guru
  • User avatar
  • Posts: 1098

Post 3+ Months Ago

That's called RDS (Remote Data Syndication, I *think* is what that stands for... if not, it should since that's basically what it means).

In a nutshell, your script grabs an XML feed (probably, or something similar anyway) and saves it into an include file. The processing for what appears is being done on the remote syndication server. Nevertheless, the concept is still the same. You have to have some programatic way to manipulate the data, otherwise the server will just stream it out as is.

Frostbyt3, look here: Learn PHP (or ASP.. or whatever scripting your hosting server supports). It will do what you're talking about very easily. It will be a valuable skill for you.

I suggest PHP, personally: http://www.php.net/

If you're into ASP, there are a number of good resourse, 4 Guys from Rolla is pretty good one (http://www.4guysfromrolla.com/)...

Don't do Coldfusion... it's like the darkside of the force, it's fast, its easy... but don't be fooled, it reduces server performance and it numbs the the mind to the real possibilties.

.c
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

Well, I have an idea.

I'm assuming that you are looking at keeping the header and footer separately so that you can just edit the content (data1, data2, data3). This is just how it seems to me.

If you are doing that, why not do it the other way round,

Code: [ Select ]
<!--#include file="header.html"-->

words

<!--#include file="footer.html"-->
  1. <!--#include file="header.html"-->
  2. words
  3. <!--#include file="footer.html"-->

Then store each of the "words" files as separate html, and link to the "words" files.

That would work if you are doing what I think you are doing. If you are not, then ignore me :D

Post Information

  • Total Posts in this topic: 9 posts
  • Users browsing this forum: No registered users and 146 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.