So I'm trying to add my header file to the results of a cgi insite search directory script.

Currently the page that it displays is pretty fugly, and does not match my site.

sub return_html {
print "Content-type: text/html\n\n";
print "<html>\n <head>\n <title>Results of Search</title>\n </head>\n";
print "<body>\n <center>\n <h1>Results of Search in $title</h1>\n </center>\n";

That's what the script looks like. Where would I include a header?
I'm pretty newb with CGI, so I tried this:

$header_file = "home/caroline/public_html/mydomain.net/rion/header.txt"
sub return_html {
print "Content-type: text/html\n\n";
open(FILE,"$header_file");
while() {
print $_;
}
exit;
print "<html>\n <head>\n <title>Results of Search</title>\n </head>\n";

that didn't work (of course) only a 500 error. Please help. How do i insert my header and footer files?
I thought about just embeding the search cgi into my .php files like this:

<?php
$QSTRING = $_SERVER['QUERY_STRING'];
virtual("/cgi-bin/search.cgi".'?'.$QSTRING);
?>

and using the search scripts search form ie: "<form method=POST action="searchresults.php">" to point to a php file with the above script embedded instead of going directly to searchresults.cgi
okay of course the php embed didn't work. it displayed the searchresults.cgi perfectly, but not the results after search queries were inputted in the search.php page....