Results 1 to 10 of 10

Thread: question for professional ...

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2003
    Location
    EGYPT
    Posts
    103

    question for professional ...

    how could we put a txt file content into html page ??

  2. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    use the FileSystemObject in ASP...something like this
    VB Code:
    1. 'index.asp
    2.  
    3. <html>
    4. <body>
    5. <%
    6. Set fs = Server.CreateObject("Scripting.FileSystemObject")
    7.  
    8. Set fileName = Server.MapPath("myFile.txt")
    9.  
    10. If(fs.FileExists(filePath) then
    11.    Set getInfo = fs.OpenTextFile(fileName, 1, False)
    12.    If Not getInfo.AtEndOfStream then
    13.       Do while Not getInfo.AtEndOfStream
    14.          strLine = getInfo.ReadLine
    15.          Response.write(strLine)
    16.          Response.write("<br>")
    17.       Loop
    18.    End If
    19. Else
    20.    Response.Write("File Does Not Exist")
    21. End If
    22. %>

    there are different ways to do this...this is just one example.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  3. #3
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    or in PHP:

    Code:
    <?php
        $file = 'file/name.ext';
        if (file_exists($file)) {
            echo implode('', file($file));
        }
    ?>
    My evil laugh has a squeak in it.

    kristopherwilson.com

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Feb 2003
    Location
    EGYPT
    Posts
    103
    how could we do that even if i want the output apear in html page not asp or php

    just html page the output

    thank's

  5. #5
    Lively Member
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    96
    ?
    this outputs the included page as html page.
    the inclusion is done by asp or php ... that's all

    if you don't have php or asp you have to use shtml
    or maby javascript
    http://www.raketje.com coming..............soon................

  6. #6
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Originally posted by cgi
    how could we do that even if i want the output apear in html page not asp or php

    just html page the output

    thank's
    HTML is a markup language. You would have to use a scripting language or server-side includes (SSI through a .shtml file).
    My evil laugh has a squeak in it.

    kristopherwilson.com

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Feb 2003
    Location
    EGYPT
    Posts
    103
    hi every body

    thank's for replayes

    but the answer is

    <!--webbot bot="Include" U-Include="file.txt" TAG="BODY" -->



  8. #8
    Lively Member morrowasted's Avatar
    Join Date
    Aug 2003
    Location
    Houston, TX
    Posts
    118
    ^^^^ only works with frontpage bot things, i think only shows up in IE

    -morrowasted

  9. #9
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Actually, I think it just needs the server to have Frontpage extenstions installed, or something.

    It's not THE answer, it's AN answer. And we gave you others that were just as viable and also depended on something being installed on the server.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  10. #10
    Lively Member morrowasted's Avatar
    Join Date
    Aug 2003
    Location
    Houston, TX
    Posts
    118
    go with the PHP.

    its easy to use, small, and its easy to write correlative scripts for it (to edit the text file from user input, etc).

    and see how much code it took in ASP? psh....

    PHP is easy to install on an Apache server, and free, so id go with that.

    -morrowasted

Posting Permissions

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



Click Here to Expand Forum to Full Width