<!--#include file="header.include.shtml" --> <hr COLOR="#CCCCCC" size=1 NOSHADE> <!--#exec cgi="/cgi-bin/test.cgi"--> <!--#include file="footer.include.shtml" -->
#!/usr/bin/perl use CGI qw(:standard); print "Content-type: text/html\n\n"; my $dir = '/home/lawlist/www'; my $query = new CGI; my $name = $query->param('name'); my $file = $dir . "/" . $name; if ($name) { open(FILE,'/home/lawlist/www/header.include.shtml') and print <FILE> +; close FILE; } opendir(DIR, $dir) or die $!; while (my $file = readdir(DIR)) { next unless (-f "$dir/$file"); next unless ($file =~ m/\.txt|.el$/); print '<a href="/cgi-bin/test.cgi?name=' . $file . '">' . $file . "< +/a>" . "<br>" . "\n\n"; } closedir(DIR); if ($name) { open (DATA, $file) or return $self->print_json_error($self->language +('ERR_CANNOT_OPEN', $file->{name}, $!)); read (DATA, my $file, -s DATA); close DATA; print "<br>\n\n<br>\n\n"; print '<pre class="brush: lisp">' . "\n\n" . $file . "\n" . '</pre> +'; print "\n\n<br>\n"; open(FILE,'/home/lawlist/www/footer.include.shtml') and print <FILE> +; close FILE; } exit 0;
In reply to Is it possible to output to an open web page? by lawlist
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |