|
I am trying to "Insert Contents of .txt file" into a .html page. They both reside in the same directory.
The html file is called index.htm
The text file is called notes.txt
It resides on my intranet.
This should be easy .. I dont want anything fancy.
Thank you :)
|
|
|
HTML can't do this. You'll need server-side code. Do a web search on "server side include".
|
|
|
|
|
Tgreer is right. Your question is not an "HTML" question, but if you had know that, you probably would not have needed to ask the question in the first place.
If your intranet site is hosted on a Windows webserver, you probably by default can serve .ASP pages. I don't think SSI (Server-side includes) will be enabled by default, but like tgreer said, look that up to figure out how to enable it in IIS if it is not already.
Then you can just rename your .HTM/.HTML page to .ASP and do something like this:
<html>
<body>
<pre>
<!--#include virtual="/test.txt"-->
</pre>
</body>
</html> |
|
By naming this file something.asp, it allows the webserver to process the file rather than just serve it. Even though the page does not have any ASP code in it, you need to name it .asp for the include directive to be processed.
If your web server is apache on linux, then you can do the exact same thing--just name the file with a .PHP extension. Again, you may need to configure the webserver to allow SSI.
|
|
|
|
|
Is there a free version of a Webserver from Microsoft ?
My "intranet" is a bunch of .html pages that were indexed by dir2html (which just makes new index.htm files for an entire directory).
:)
How might one run a "intranet" with an Microsoft Access Backend.
Or How might I run an intranet with a backend that can easily access Microsoft Access data (in .mdb files).
:)
|
|
|
Do you think there might be some .cgi code that might do that ?
Or some locally executed Java code ?
|
|
|
Whoa! Whoa!...don't go CGI and Java on me! :)
It's much simpler than that. Microsoft, the king of licensing and squeezing every penny out of every line of code does in fact offer a free webserver--Microsoft Internet Information Server (IIS). In fact, it's the #2 webserver in use on the Internet. (Apache is #1.)
Apache is open-source and runs on Unix, Linux, MacOSX and Windows. I'd recommend it, but it can be very daunting for a new user. And for what your purposes are, IIS will serve you very well. No reason to make this difficult.
IIS is freely available for Windows server versions. You can also run IIS on XP Pro, but it has a 10 user connection limit (I think).
So hopefully you have a Windows 2000 or 2003 server on your network? If so, you can install IIS using the Add Windows Components wizard. You may need your Windows CD.
Once installed, you use the IIS Manager to administrate the IIS service.
I don't really have the time to walk you through step by step on this, but just search Microsoft for IIS information. With IIS you'll be able to run ASP scripts. With ASP, you can work with data sources including Access mdb files.
You are at the beginning of a rather long journey, my friend. But your patience and discipline will be rewarded!
|
|
|
|
|
use PHP for crist sake!
www.w3schools.com
search file operations and stuff.. easy code.
regards.
|
|
|
Although a server scripting language will give you the most control over your presented code in the browser, sometimes I find it necessary to wirte javascript to maintain some unity in the existing code structure. The following javascript will give you what you require w/o having to program on the serverside.
(Save this as a text file) : m_menu.txt
---------------------------------------------------------------------
// Script provided by esapplications.com
var m_count = 0;
m_items = new Array(
"<a href=''><font color='#ffffff'><b>Menu Item 1</b></font></a>",
"<a href=''><font color='#ffffff'><b>Menu Item 2</b></font></a>",
"<a href=''><font color='#ffffff'><b>Menu Item 3</b></font></a>",
"<a href=''><font color='#ffffff'><b>Menu Item 4</b></font></a>"
)
while (m_count < 4){ // equals the # of m_items
document.write(m_items[m_count]+"<br>");
m_count++;
}
---------------------------------------------------------------------
insert this code in your html page:
---------------------------------------------------------------------
<script Language="Javascript" type="text/javascript" src="/forum/m_menu.txt"></script>
Happy Coding,
Craig S. Baucom
esappications.com
|
|
|
how about this:
<object width='100%' height='500' type='text/plain' data='/forum/textfile.txt' border='0' ></object>
|
|
|
Web Hosting
http://www.webspacehosting.in
Web Space Hosting is a free research guide to help users in India
to choose the right web host for their personal or business site.
Our focus is on providing a simple, easy to follow web site
to help users in India choose the best web hosting plan,
most suitable for a small site or for a large e-commerce web site.
The web hosting sites, which were rated highest in the industry,
are listed below and are rated based on affordability, reliability,
uptime and tech support.
|
|
|
That was nice it created a text box but didnt read info from file
|
|
|
<object data="archivo.html" type="all" width="600"></object>
o
<object data="/forum/archivo.txt" type="all" width="600"></object>
funcionan.
|
|
|