View Full Version : upload my text
yhack
June 23rd, 2004, 02:37 PM
can i have a html page with a box then in like a text file i write what i want it to say the box
the box would be blank then it loads up the text and i can edit the text file as i want without goinin and changin the html file
Hans Kilian
June 23rd, 2004, 03:18 PM
If you make an IFRAME in your HTML page and have it link to your text file, then I think it'll work like you want it to.
And congratulations on your 100th post here on Kirupa :)
yhack
June 23rd, 2004, 03:37 PM
thx, whats a IFRAME? its probably easy but i dont know
Hans Kilian
June 23rd, 2004, 03:51 PM
<html>
<head><title>test</title></head>
<body>
<iframe src="textfile.txt" width="450" height="100">
</body>
</html>
It stands for 'inline frame'...
yhack
June 23rd, 2004, 04:01 PM
wow ur too helpful!! thanks!!!!
yhack
June 23rd, 2004, 04:41 PM
is it possible to make the background of it a different colour?
Hans Kilian
June 24th, 2004, 02:37 AM
I've been trying some stuff out, but nothing seems to work. You could easily change the color if the file shown in the iframe was an HTML file. But it isn't...
Maybe someone else has an idea?
Hans Kilian
June 24th, 2004, 12:26 PM
OK - I've thought a bit more about this and I can come up with a couple of ways you can change the background colour. They both involve converting your text file to HTML.
The simple way is to have the Iframe point to an HTML file that has a very basic page with the background colour you want. Then you use server-side including to make your text file the body of the document.
Another - a bit more convoluted way - does basically the same thing, but reads the text file with PHP or ASP and outputs an HTML page.
What solution is best for you depends on what features you have available on your web server.
yhack
June 24th, 2004, 12:35 PM
thanks
ol4pr0
July 7th, 2004, 11:53 PM
why not something like this
#make a php file called frame.php
#than use the iframe code used above
#replace src="textfile.text"
#with
# src="frame.php" with the following code
$file ="sometext.txt";
$fh = fopen($file,'r') or die ("couldnt open file to read");
$file_size =filesize($file);
$file_content = fread($fh,$file_size);
fclose ($fh);
echo '<body bgcolor="red"><font size="2">
echo '<pre>';
echo $file_content;
echo '</pre>';
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.