Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

read text file and display on webpage

Status
Not open for further replies.

nswan12

Programmer
Dec 19, 2002
1
GB
Hi,

has anybody got any code to read a text file and display the output on a webpage?

Thanks
Nick
 
hello,

do something like this

print &quot;<HTML>&quot;;
open (FILE, &quot;file.txt&quot;);
while ($line = <FILE)
{
print &quot;<P> $line </P>&quot;;
}
close (FILE);
print &quot;</HTML>&quot;;
 
Don't forget to
Code:
print &quot;Content-type:text/html\n\n&quot;;
before attempting to print out HTML code.
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top