in reply to Need to print file contents on page
You should print Headers before any other operation - this allows you to report error messages if necessary.
Remember that the $file location is relative to the web root.
Error check your file open, and report accordingly.
UNTESTED.print "Content-type:text/html\n\n"; # Or $cgi->header... open(my $DF,'<',$file) or print $cgi->h1("Error opening $file:$!"); while (defined (my $line = <$DF>)) { print $line, $cgi->br(); } close $DF;
Update: I just noticed this is a dup of 11102294. Please reap main node and all replies including this one.
2019-07-28 Athanasius reparented
Time is an illusion perpetrated by the manufacturers of space.
|
|---|