in reply to fake SSI
Having said that, let's take a look at a visually enhanced version of what you found.
sub print_html_page_w_ssi { # grab the .html filename passed as a parameter $a = shift; # zap any backslashes in the name # (note: we seem to be on a windows machine) $a =~ s/\\//g; # spiff up the filename, if needed $a = glob($a); # grab its contents (i.e. the html code itself) in $_ $_ = `cat $a`; # print out the http header print "Content-type: text/html\n\n"; # process any ssi tags in $_ one-by-one while ( /<!--#exec cgi="([^"]*)"-->/ ) { # now the name of the ssi file is in $1 # run that file and grab its output in $a $a = `$1`; # put a <br> with each line terminator $a =~ s/\n/<br>\n/g; # and substitute that output for # the ssi tag where it occurs in $_ s/<!--#exec cgi="([^"]*)"-->/$a/; } # print the resulting page (which is still # in $_) to the waiting web client print; }
|
|---|