Log in

View Full Version : Importing notepad text files into Webpage



Coulee
12-25-2007, 05:42 PM
Merry Christmas to all:

I am developing a new website. I want to have a webpage designed so it looks nice and clean with links on the right side. When someone clicks on a link, I want a new page to open similar to the page I just mentioned, and have individual data from a notepad text file import into this page.

I know how to set a new page to open, but don't quite know how to have the text file import into this page. Any ideas appreciated.

Coulee

BLiZZaRD
12-25-2007, 08:11 PM
So basically you want to display the contents of a file.txt from your server onto the page in the browser?



<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Included dot text file</title>
<style type="text/css">
#imported {
width:250px;
height:158px;
position:absolute;
}
</style>
</head>

<body>
//the page HTML goes here, you can make it look how ever you want. Then
//when you want the file.txt shown use php include function:
<div id="imported">
<?php include 'http://yoursite.com/file.txt'; ?>
</div>
//and where ever you put that the .txt will appear.
</body>
</html>


Of course, this may not be what you are talking about, exactly, but php include is one of the easiest ways to include other file types or other page's codes in a certain spot.

Coulee
01-06-2008, 10:55 AM
Blizzard:

Thanks for the code, been to busy at work to even spend time on this project. Second question if you have time, and it is much appreciated if you do.

I follow your code, but if I had 10 links on the right side menu (static part of page), my body of the webpage is fluid to fit all screens, if viewers click on one link, no problem, how do I make it so if they click on each of those links, the text will display on the page. Maybe I'm missing something here. Been too long I think,

coulee

BLiZZaRD
01-06-2008, 11:54 AM
Ugg.. frames *shudder*