INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: I Need Some HTML Help  (Read 4066 times)

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20063
I Need Some HTML Help
« on: July 31, 2003, 04:43:59 am »

This is basicly for Lyrics i am working on.

Lets say i have a Text file "Test.txt" and i want to include it into a HTML file where the HTML file will pull up this text file and display it as part of the HTML file.

is there a way to do this?

If so how.
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

Stilton

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 56
Re: I Need Some HTML Help
« Reply #1 on: July 31, 2003, 04:53:49 am »

If your server supports server-side includes, you could do;
Code: [Select]

<!--#include file="textfiles/test.txt"-->

or whatever. You could put formatting around it, say with;

Code: [Select]

<font face=""verdana"" size=""1"" align=""center"">
<!--#include file="textfiles/test.txt"-->
</font>


etc.
Logged

knickelfarz

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 493
Re: I Need Some HTML Help
« Reply #2 on: July 31, 2003, 04:54:33 am »

If it's local, try this:

<html>
<head>
<title>InnerText</title>
<script language="JavaScript" type="text/javascript">
<!--
function bigger() {
document.getElementById("TXT").width="640";
document.getElementById("TXT").height="480";
}
//-->
</script>
</head>
<body>
<p><object id="TXT" data="Test.txt" type="text/plain" width="300" height="400" border="1">
</object></p>
<p><a href="javascript:bigger()">Make it bigger![/url]</p>
</body>
</html>
Logged

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20063
Re: I Need Some HTML Help
« Reply #3 on: July 31, 2003, 05:26:44 am »

thanks, i will try this when i get home.
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20063
Re: I Need Some HTML Help
« Reply #4 on: July 31, 2003, 07:33:46 am »

both seem to work well (thanks)

is there an advantage of one over the other?
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

knickelfarz

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 493
Re: I Need Some HTML Help
« Reply #5 on: July 31, 2003, 10:50:55 am »

Quote
is there an advantage of one over the other?


It depends upon your plans...

I think iframes are easier to use in most cases as you can treat them as normal frames with links and so on.
Objects allows some special tricks with local databases, for example.
Server-side includes require HTTP surroundings.


Logged

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20063
Re: I Need Some HTML Help
« Reply #6 on: July 31, 2003, 11:51:41 am »

lets say i have a program that counts the number of lyrics (currently it is about 50,000 lyrics) and it writes this info into a file called "LyricsCount.txt" and if i wish to display this info into the html is there a way to push this info into a textbox or pull this info into the html without frams?

my test page
http://www.spartasoft.com/test.htm
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

knickelfarz

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 493
Re: I Need Some HTML Help
« Reply #7 on: July 31, 2003, 12:59:44 pm »

If I just wanted to *display* a textfile, I would use an iframe as a box - but the backgound will always be white...

If I wanted to see the *content* with a certain font or background color, i just would not let the program write a text file but a simple html file...

If I wanted to *put the content* of the textfile into the html, I would use the "object" tag together with a standard ActiveX plugin to really *read* the text file.
(The plugin comes with IE, and it's of course only working with IE...)

Example....

lyrics.txt:

A|B|C|D|E
Blah|Tralala|Oh Girl|I love you|Huhu

html:

<html>
<head><title>Test</title></head>
<body>
<object id="Lyrics" classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83">
<param name="DataURL" value="lyrics.txt">
<param name="UseHeader" value="true">
<param name="FieldDelim" value="|">
</object>
<table id="MyTab" datasrc="#Lyrics" datapagesize="1" width="100%" border="1"><tr>
<td><span datafld="A"></span></td>
<td><span datafld="B"></span></td>
<td><span datafld="C"></span></td>
<td><span datafld="D"></span></td>
<td><span datafld="E"></span></td>
</tr></table>
</body>
</html>
Logged

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20063
Re: I Need Some HTML Help
« Reply #8 on: July 31, 2003, 01:09:25 pm »

Quote
If you want to see the *content* with a certain font or background color, i just would not let the program write a text file but a simple html file...


well maybe i can use the iframe without scroll and that should look like a textbox. but i wish to include this on a page thats why i do not want to write it just as an html
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

knickelfarz

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 493
Re: I Need Some HTML Help
« Reply #9 on: July 31, 2003, 01:21:21 pm »

If it's just a number or short text, use iframes ;)
If it's more, look at my edited post above ;)
Logged

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20063
Re: I Need Some HTML Help
« Reply #10 on: July 31, 2003, 02:05:30 pm »

well i could not get the modfied html to work

but i guess the iframes will work.

the test page

http://www.spartasoft.com/test.htm

is working
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

nila

  • Guest
Re: I Need Some HTML Help
« Reply #11 on: July 31, 2003, 11:58:02 pm »

King - whats your server setup?

IIS? Apache?

Windows?


Your best bet would be to use a server side scripting then you could pull in the data from the text file and do whatever you wanted with it literally.


If it's from your home server then setting up Apache with php isn't too hard.
Logged

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20063
Re: I Need Some HTML Help
« Reply #12 on: August 01, 2003, 02:24:46 am »

Apache II
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20063
Re: I Need Some HTML Help
« Reply #13 on: August 01, 2003, 11:01:27 am »

Quote
You might just try the SSI method: <!--#include file="path/file.txt" -->

You may have to rename your HTML file as .shtml or perhaps set the execute bit on the .html file: chmod +x file.html



thats easy for you to say, can you write a sample html for me?

I can't spell too good yet, i go to 3rd grade this Aug
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20063
Re: I Need Some HTML Help
« Reply #14 on: August 01, 2003, 11:30:19 am »

Quote
I'm not sure how you have Apache setup, but try creating this:

test.shtml
------------

<html>
 <body>
   <!--#include file="LyricsCount.txt" -->
 </body>
</html>


this does not work.
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA
Pages: [1]   Go Up