I am getting a blank add_success screen when adding a new record and also when I modify it doesn't modify but adds a new record leaving the old one there as well. I have enclosed the subroutines that i suspect are the culprits but I can't figure it out. Much obliged if anyone can spot my error.
sub html_add_success {
# --------------------------------------------------------
# The page that is returned upon a successful addition to
# the database. You should use &get_record and &html_record
# to verify that the record was inserted properly and to make
# updating easier.
&html_print_headers;
print qq|
<html>
<head>
<title>$html_title: Record Added.</title>
</head>
<body bgcolor="#DDDDDD">
<center>
<table border=1 bgcolor="#FFFFFF" cellpadding=5 cellspacing=3 width=500 align=center valign=top>
<tr><td colspan=2 bgcolor="navy">
<FONT FACE="MS Sans Serif, arial,helvetica" size=1 COLOR="#FFFFFF">
<b>$html_title: Record Added</b>
</td></tr>
<tr><td>
<p><center><$font_title><b>
Record Added
</b></font></center><br>
<$font>
<P><Font face="Verdana, Arial, Helvetica" Size=2>The following record was successfully added to the database:</FONT>
|; &html_record(&get_record($in{$db_key})); print qq|
</font></p>
|; &html_footer; print qq|
</td></tr>
</table>
</center>
</body>
</html>
|;
}
and
sub html_record {
# --------------------------------------------------------
# How a record will be displayed. This is used primarily in
# returning search results and how it is formatted. The record to
# be displayed will be in the %rec hash.
my (%rec) = @_; # Load any defaults to put in the VALUE field.
$rec{'Quote'} =~ s/\n/<br>/g;
($db_auto_generate and print &build_html_record(%rec) and return);
my $font_color = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399';
my $font = 'Font face="Verdana, Arial, Helvetica" Size=2';
if ($rec{'Category'} ne $tmp_category ){
&tmp_category;
}
print qq|<center>
<table border=1 bgcolor="#FFFFFF" cellpadding=5 cellspacing=3 width=500 align=center valign=top>
<tr><td colspan=2 bgcolor="ffffff">
<FONT FACE="MS Sans Serif, arial,helvetica" size=2 COLOR="#000000">
<center><br>$rec{'Quote'}<br></center><p>Submitted: $rec{'Date'}</p>
</td></tr></table>|;
}
sub tmp_category{
my (%rec) = @_;
($db_auto_generate and print &build_html_record(%rec) and return);
$number_of_categories++;
$tmp_category=$rec{'Category'};
print qq|<center>
<table border=1 bgcolor="#FFFFFF" cellpadding=5 cellspacing=3 width=500 align=center valign=top>
<tr><td colspan=2 bgcolor="navy">
<FONT FACE="MS Sans Serif, arial,helvetica" size=2 COLOR="#FFFFFF">
<b><center><em>$tmp_category</em></center></b>
</td></tr></table>|;
I have not edited anything in the modify section of html.pl so I don't think that is where the problem is. I suspect it is in html_record where I change categories.
sub html_add_success {
# --------------------------------------------------------
# The page that is returned upon a successful addition to
# the database. You should use &get_record and &html_record
# to verify that the record was inserted properly and to make
# updating easier.
&html_print_headers;
print qq|
<html>
<head>
<title>$html_title: Record Added.</title>
</head>
<body bgcolor="#DDDDDD">
<center>
<table border=1 bgcolor="#FFFFFF" cellpadding=5 cellspacing=3 width=500 align=center valign=top>
<tr><td colspan=2 bgcolor="navy">
<FONT FACE="MS Sans Serif, arial,helvetica" size=1 COLOR="#FFFFFF">
<b>$html_title: Record Added</b>
</td></tr>
<tr><td>
<p><center><$font_title><b>
Record Added
</b></font></center><br>
<$font>
<P><Font face="Verdana, Arial, Helvetica" Size=2>The following record was successfully added to the database:</FONT>
|; &html_record(&get_record($in{$db_key})); print qq|
</font></p>
|; &html_footer; print qq|
</td></tr>
</table>
</center>
</body>
</html>
|;
}
and
sub html_record {
# --------------------------------------------------------
# How a record will be displayed. This is used primarily in
# returning search results and how it is formatted. The record to
# be displayed will be in the %rec hash.
my (%rec) = @_; # Load any defaults to put in the VALUE field.
$rec{'Quote'} =~ s/\n/<br>/g;
($db_auto_generate and print &build_html_record(%rec) and return);
my $font_color = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399';
my $font = 'Font face="Verdana, Arial, Helvetica" Size=2';
if ($rec{'Category'} ne $tmp_category ){
&tmp_category;
}
print qq|<center>
<table border=1 bgcolor="#FFFFFF" cellpadding=5 cellspacing=3 width=500 align=center valign=top>
<tr><td colspan=2 bgcolor="ffffff">
<FONT FACE="MS Sans Serif, arial,helvetica" size=2 COLOR="#000000">
<center><br>$rec{'Quote'}<br></center><p>Submitted: $rec{'Date'}</p>
</td></tr></table>|;
}
sub tmp_category{
my (%rec) = @_;
($db_auto_generate and print &build_html_record(%rec) and return);
$number_of_categories++;
$tmp_category=$rec{'Category'};
print qq|<center>
<table border=1 bgcolor="#FFFFFF" cellpadding=5 cellspacing=3 width=500 align=center valign=top>
<tr><td colspan=2 bgcolor="navy">
<FONT FACE="MS Sans Serif, arial,helvetica" size=2 COLOR="#FFFFFF">
<b><center><em>$tmp_category</em></center></b>
</td></tr></table>|;
I have not edited anything in the modify section of html.pl so I don't think that is where the problem is. I suspect it is in html_record where I change categories.