Results 1 to 4 of 4

Thread: Importing notepad text files into Webpage

  1. #1
    Join Date
    Dec 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Importing notepad text files into Webpage

    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

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    So basically you want to display the contents of a file.txt from your server onto the page in the browser?

    HTML Code:
    <!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.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Dec 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

  4. #4
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Ugg.. frames *shudder*
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •