Web Development Thread, Import a text file into a live web page in Coding and Web Development; This is probably a really basic thing to do, but is beyond me at the moment! I am putting together ...
28th January 2008, 10:13 PM #1
- Rep Power
Import a text file into a live web page
This is probably a really basic thing to do, but is beyond me at the moment! I am putting together a standardised Home Page for the school, Firefox stylee, and want to have text on there taken from a .txt file which will also be kept on the server, but accessible by the Head/secretary etc for dates, messages etc.
The trouble I'm having is I don't know how to get the .html code to go to a text file and read it. Any suggestions/ideas?
28th January 2008, 10:51 PM #2
You can't do it directly with html, but you can with some form of language - either client or server side.
Personally I would say the easiest way would be to use shtml. http://httpd.apache.org/docs/1.3/howto/ssi.html
Or you could use php, and the include tag: http://uk.php.net/include/
Or, if you're feeling evil, you could use an iframe to do it: http://www.w3schools.com/tags/tag_iframe.asp
Thanks to localzuk from:
mrlegs (29th January 2008)
28th January 2008, 11:56 PM #3
To extend on what localzuk has said. If you're using Apache as your webserver then a nice PHP include is what I'd use.
If you're using IIS and don't want to switch to Apache or install PHP for IIS then you could use the SSI method that localzuk has linked to within IIS. A bit of googling will tell you how to enable shtml and SSIs within IIS.
Last edited by Joedetic; 29th January 2008 at 12:00 AM.
29th January 2008, 09:36 AM #4
Maybe its overkill but have you looked at the EduGeek Joomla! package? this is a full featured site in one package ready to deploy on a web server.
search here for it, its pretty smart.
29th January 2008, 09:59 AM #5
- Rep Power
It certainly seems like the direction the school is heading, and I know Joomla is quite effective as an intranet device.
Thanks for all the ideas folks. I will attempt them in order!
29th January 2008, 10:43 AM #6
I'd also suggest sharepoint
we use it for our intranet and its been great!
29th January 2008, 12:33 PM #7
Surely you can just just the include option that should work in basic html??
29th January 2008, 12:47 PM #8
That only works with server-side SHTML.
Originally Posted by limbo
29th January 2008, 02:13 PM #9
If you have PHP:
If you want to do this in STRAIGHT HTML (no serverside stuff needed) you could use regular frames:
or for the uber hack: rename the .txt to .htm!!
or, you MIGHT just be asking for a simple thing like how to link to other documents rather than show the document on a .htm, to do this you just use a hyperlink like so:
<a href="somedoc.txt">Some Description Here</a>
Last edited by Friez; 29th January 2008 at 02:16 PM.
29th January 2008, 02:56 PM #10
Just a quick note though - frames are not very accessible to those with poor eye-sight etc...
By thom in forum ICT KS3 SATS Tests
Last Post: 20th May 2009, 03:27 PM
By timbo343 in forum Scripts
Last Post: 7th March 2007, 03:37 PM
By PiqueABoo in forum Scripts
Last Post: 13th December 2006, 11:09 PM
By broc in forum ICT KS3 SATS Tests
Last Post: 21st March 2006, 01:11 PM
By adamyoung in forum How do you do....it?
Last Post: 9th February 2006, 02:35 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)