Weapon
May 8th, 2001, 06:47
Well I really need some help so here goes. Ihave this script that part of it looks like this:
sub return_html {
local($key,$sort_order,$sorted_field);
if ($Config{'redirect'}) {
print "Location: $Config{'redirect'}\n\n";
}
else {
print "Content-type: text/html\n\n";
print "<html>\n <head>\n";
if ($Config{'title'}) { print " <title>$Config{'title'}</title>\n" }
else { print " <title>thank you</title>\n" }
print " </head>\n <body";
&body_attributes;
print ">\n <center>\n";
if ($Config{'title'}) { print " <h1>$Config{'title'}</h1>\n" }
else { print " <h1>Thank You For Filling Out This Form</h1>\n" }
print "</center>\n";
print "Below is what you submitted to $Config{'recipient'} on ";
print "$date<p><hr size=1 width=75\%><p>\n";
if ($Config{'sort'} eq 'alphabetic') {
foreach $field (sort keys %Form) {
if ($Config{'print_blank_fields'} || $Form{$field}) {
print "<b>$field:</b> $Form{$field}<p>\n";
}
}
}
elsif ($Config{'sort'} =~ /^order:.*,.*/) {
$sort_order = $Config{'sort'};
$sort_order =~ s/(\s+|\n)?,(\s+|\n)?/,/g;
$sort_order =~ s/(\s+)?\n+(\s+)?//g;
$sort_order =~ s/order://;
@sorted_fields = split(/,/, $sort_order);
foreach $sorted_field (@sorted_fields) {
if ($Config{'print_blank_fields'} || $Form{$sorted_field}) {
print "<b>$sorted_field:</b> $Form{$sorted_field}<p>\n";
}
}
}
else {
foreach $field (@Field_Order) {
if ($Config{'print_blank_fields'} || $Form{$field}) {
print "<b>$field:</b> $Form{$field}<p>\n";
}
}
}
print "<p><hr size=1 width=75%><p>\n";
if ($Config{'return_link_url'} && $Config{'return_link_title'}) {
print "<ul>\n";
print "<li><a href=\"$Config{'return_link_url'}\">$Config{'return_link_title'}</a>\n";
print "</ul>\n";
}
print <<"(END HTML FOOTER)";
</body>
</html>
(END HTML FOOTER)
}
}
sub send_mail {
and this is my layout:
<html>
<head>
<title>home</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body background="images/background.gif">
<div align="center"><center>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="140" valign="top" rowspan="2"></td>
<td valign="top"><p align="center"><!--#include file="menu.txt" --></p>
<hr width="90%" size="1" color="#000000">
<p><font size="2"></font></td>
</tr>
<tr>
<td valign="top"><font size="2"><p align="center"><!--#include file="disclaimer.txt" --></font></td>
</tr>
</table>
</center></div>
</body>
</html>
now is there a thing to do so that the layout is merged with the script? what I mean by that is make the script look in the layout of the layout script, to simplfy that, make no.1 look like no.2's layout but still in cgi
sub return_html {
local($key,$sort_order,$sorted_field);
if ($Config{'redirect'}) {
print "Location: $Config{'redirect'}\n\n";
}
else {
print "Content-type: text/html\n\n";
print "<html>\n <head>\n";
if ($Config{'title'}) { print " <title>$Config{'title'}</title>\n" }
else { print " <title>thank you</title>\n" }
print " </head>\n <body";
&body_attributes;
print ">\n <center>\n";
if ($Config{'title'}) { print " <h1>$Config{'title'}</h1>\n" }
else { print " <h1>Thank You For Filling Out This Form</h1>\n" }
print "</center>\n";
print "Below is what you submitted to $Config{'recipient'} on ";
print "$date<p><hr size=1 width=75\%><p>\n";
if ($Config{'sort'} eq 'alphabetic') {
foreach $field (sort keys %Form) {
if ($Config{'print_blank_fields'} || $Form{$field}) {
print "<b>$field:</b> $Form{$field}<p>\n";
}
}
}
elsif ($Config{'sort'} =~ /^order:.*,.*/) {
$sort_order = $Config{'sort'};
$sort_order =~ s/(\s+|\n)?,(\s+|\n)?/,/g;
$sort_order =~ s/(\s+)?\n+(\s+)?//g;
$sort_order =~ s/order://;
@sorted_fields = split(/,/, $sort_order);
foreach $sorted_field (@sorted_fields) {
if ($Config{'print_blank_fields'} || $Form{$sorted_field}) {
print "<b>$sorted_field:</b> $Form{$sorted_field}<p>\n";
}
}
}
else {
foreach $field (@Field_Order) {
if ($Config{'print_blank_fields'} || $Form{$field}) {
print "<b>$field:</b> $Form{$field}<p>\n";
}
}
}
print "<p><hr size=1 width=75%><p>\n";
if ($Config{'return_link_url'} && $Config{'return_link_title'}) {
print "<ul>\n";
print "<li><a href=\"$Config{'return_link_url'}\">$Config{'return_link_title'}</a>\n";
print "</ul>\n";
}
print <<"(END HTML FOOTER)";
</body>
</html>
(END HTML FOOTER)
}
}
sub send_mail {
and this is my layout:
<html>
<head>
<title>home</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body background="images/background.gif">
<div align="center"><center>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="140" valign="top" rowspan="2"></td>
<td valign="top"><p align="center"><!--#include file="menu.txt" --></p>
<hr width="90%" size="1" color="#000000">
<p><font size="2"></font></td>
</tr>
<tr>
<td valign="top"><font size="2"><p align="center"><!--#include file="disclaimer.txt" --></font></td>
</tr>
</table>
</center></div>
</body>
</html>
now is there a thing to do so that the layout is merged with the script? what I mean by that is make the script look in the layout of the layout script, to simplfy that, make no.1 look like no.2's layout but still in cgi