|
-
Sep 17th, 2003, 10:00 AM
#1
Thread Starter
Lively Member
question for professional ...
how could we put a txt file content into html page ??
-
Sep 17th, 2003, 10:28 AM
#2
Frenzied Member
use the FileSystemObject in ASP...something like this
VB Code:
'index.asp
<html>
<body>
<%
Set fs = Server.CreateObject("Scripting.FileSystemObject")
Set fileName = Server.MapPath("myFile.txt")
If(fs.FileExists(filePath) then
Set getInfo = fs.OpenTextFile(fileName, 1, False)
If Not getInfo.AtEndOfStream then
Do while Not getInfo.AtEndOfStream
strLine = getInfo.ReadLine
Response.write(strLine)
Response.write("<br>")
Loop
End If
Else
Response.Write("File Does Not Exist")
End If
%>
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
-
Sep 17th, 2003, 02:15 PM
#3
Stuck in the 80s
or in PHP:
Code:
<?php
$file = 'file/name.ext';
if (file_exists($file)) {
echo implode('', file($file));
}
?>
-
Sep 18th, 2003, 03:48 AM
#4
Thread Starter
Lively Member
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
-
Sep 18th, 2003, 06:25 AM
#5
Lively Member
?
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................
-
Sep 18th, 2003, 10:14 AM
#6
Stuck in the 80s
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).
-
Sep 18th, 2003, 04:58 PM
#7
Thread Starter
Lively Member
hi every body
thank's for replayes
but the answer is
<!--webbot bot="Include" U-Include="file.txt" TAG="BODY" -->
-
Sep 18th, 2003, 06:14 PM
#8
Lively Member
^^^^ only works with frontpage bot things, i think only shows up in IE

-morrowasted
-
Sep 18th, 2003, 06:35 PM
#9
Stuck in the 80s
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.
-
Sep 18th, 2003, 07:41 PM
#10
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|