Pulling a small text file into HTML? Easy? Bah!

S

Steve

Hi!

Can anyone help me with this little problem? I just want to be able to pull
in a small (say 3 or 4 lines) external text file of gig dates into a table
cell on my band website. Am I right in thinking the only way to go about
this is by making it an .xml file, then turning each of my pages into XSLT
pages and then referencing the .xml and displaying client side? This all
seems extremely complicated!! Is there an easier way I have completely
overlooked?! If anyone could help me I'm really looking for help learning
something new here :)

Cheers!

Steve
 
S

Steve

Ahh sorry - yes, I forget to mention that I don't wanna use any server side
languages if at all possible...

S.



??>> Can anyone help me with this little problem? I just want to be
??>> able to pull in a small (say 3 or 4 lines) external text file of
??>> gig dates into a table cell on my band website. Am I right in
??>> thinking the only way to go about this is by making it an .xml
??>> file, then turning each of my pages into XSLT pages and then
??>> referencing the .xml and displaying client side? This all seems
??>> extremely complicated!! Is there an easier way I have completely
??>> overlooked?! If anyone could help me I'm really looking for help
??>> learning something new here :)

BtS> A PHP include? I'm asking because I've never done this inside a
BtS> table, but it seems like it would work.


With best regards, Steve. E-mail: (e-mail address removed)
 
B

Blinky the Shark

Steve said:
Can anyone help me with this little problem? I just want to be
able to pull in a small (say 3 or 4 lines) external text file of
gig dates into a table cell on my band website. Am I right in
thinking the only way to go about this is by making it an .xml
file, then turning each of my pages into XSLT pages and then
referencing the .xml and displaying client side? This all seems
extremely complicated!! Is there an easier way I have completely
overlooked?! If anyone could help me I'm really looking for help
learning something new here :)

A PHP include? I'm asking because I've never done this inside a
table, but it seems like it would work.
 
J

JDS

This all
seems extremely complicated!!


Wow, you are right. Don't know what your server specs are, but there are
ways to do this on pretty much any webserver.

Google on:
SSI

PHP includes

ASP

ASP will let you use the same syntax as SSI.

SSI/ASP can be as simple as this:

<table>
<tr>
<td>
<!--#include virtual="gig_dates.html" -->
</td>
</tr>
</table>

The "#include" line in PHP would look like this:

<?php include("gig_dates.html")?>


later...
 
S

Steve

Cheers for the help guys - but let me now make it a bit more tricky;
firstly, as I said I can't use PHP, ASP, etc as I am using a cheap ass
server! Secondly, it has to be pulling in a simple file as the person
assigned to editing it has no HTML knowledge!

S.
 
M

mbstevens

Steve said:
Ahh sorry - yes, I forget to mention that I don't wanna use any server side
languages if at all possible...

S.



??>> Can anyone help me with this little problem? I just want to be
??>> able to pull in a small (say 3 or 4 lines) external text file of
??>> gig dates into a table cell on my band website. Am I right in
??>> thinking the only way to go about this is by making it an .xml
??>> file, then turning each of my pages into XSLT pages and then
??>> referencing the .xml and displaying client side? This all seems
??>> extremely complicated!! Is there an easier way I have completely
??>> overlooked?! If anyone could help me I'm really looking for help
??>> learning something new here :)

BtS> A PHP include? I'm asking because I've never done this inside a
BtS> table, but it seems like it would work.


With best regards, Steve. E-mail: (e-mail address removed)
Also possible are SSI, using preprocessing then uploading, or generating
the pages server side. Just be sure that whatever you put inside that
cell is valid to put there. Which way you choose to do it depends on
what is available and what your privileges are on the server.
 
M

Mitja Trampus

Steve said:
Cheers for the help guys - but let me now make it a bit more tricky;
firstly, as I said I can't use PHP, ASP, etc as I am using a cheap ass
server! Secondly, it has to be pulling in a simple file as the person
assigned to editing it has no HTML knowledge!

S.

If server side processing is not an option, you are stuck
with either
a) preprocessing at "home"
b) client-side processing
c) teaching the other guy a wee bit of HTML

I strongly recommend against (b) because either javascript
or xml/xslt are not supported widely enough (search engines,
users with disabled JS, older browsers, ...).

(a) is fine but that means that whoever is going to edit the
plain-text file must have a scripting language or an capable
preprocessor available on the local computer, make changes
to the plain-text file, run the script/preprocessor and
upload the files via FTP or web interface.
Now if he's gonna learn all that, you might just as well
skip all the fuss with preprocessors and show him what to
change in a series of blocks like
<tr><td class="gigPlace">
At me momma's house
</td><td class="gigTime">
Tuesday 9pm
</td></tr>
He doesn't need to know what all that stuff is, just to
recognize it as a delimiter. This is not hard to learn at
all. And if you enter the first few he'll always have
examples at hand.

All in all, I'm sure (c) is the simplest. Preprocessing is a
viable option, especially if you have more than just two,
three pages and can make use of a preprocessor in several
ways, not just for listing the gigs.
 
J

JDS

firstly, as I said I can't use PHP, ASP, etc as I am using a cheap ass
server! Secondly, it has to be pulling in a simple file as the person
assigned to editing it has no HTML knowledge!

How cheap? Even the cheapest of cheap web hosts these days provides some
sort of server-side processing. You said what you *don't* have -- now,
what *do* you have to work with?

And all the methods I used previously can pull in *any* kind of text file,
HTML or plain text.

And frankly, HTML is pretty easy to learn. At least the basics you would
need to update a simple file like the one you described.
 
B

Blinky the Shark

JDS said:
How cheap? Even the cheapest of cheap web hosts these days
provides some sort of server-side processing. You said what you
*don't* have -- now, what *do* you have to work with?

I'm wondering if he was using his *own* server. Notice he doesn't
say he has a cheap-ass *host*.
 
J

JDS

I'm wondering if he was using his *own* server. Notice he doesn't
say he has a cheap-ass *host*.

Right. Well, even better, if that is the case -- all the software needed
to run an advanced web server can be had for free.
 
S

Steve

Right guys, I guess I'm going to round off this thread; firstly on was on
cheap hosting - not running my own host. Secondly you were right - it's
easier to teach this guy how to edit HTML than do all of this. Shame really
as it was interesting to mess around with the XML! Thanks also for so many
truly *helpful* comments and advice - rare in some newsgroups now!

Take care!

Steve
 
S

Steve

actually it's not completely finished - I'm going to look at pulling .xml
into Flash instead :)

S.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top