I'm trying to get DBman to email the admin a record.
The DB is set so each user only has one record.
But i'm getting the field names in the email but no actual data.
In the db.pl i have:
elsif ($in{'email'}) { &html_email; }
This is in the middle of all the other elsif statements.
In the default.cgi i have:
At the begining of the file after " require $db_script_path . "/html.pl";"
In the html.pl file i have:
# --------------------------------------------------------
# %rec=&get_record($in{$db_key});
#Send email to admin
open (MAIL, "$mailprog")or &cgierr("unable to open mail program");
print MAIL "To:$admin_email\n";
print MAIL "From:$admin_email\n";
print MAIL "Subject:Points request\n";
print MAIL "-" x 75 . "\n\n";
foreach $column(@db_cols){
print MAIL "$column:$rec{$column}\n";
}
print MAIL "Forename: $rec{'forename'}\n";
close MAIL;
&html_print_headers;
print qq|
<html>
<head>
<title>Test</title>
<style type="text/css"> <!--
A:hover {
color : Gray;
text-decoration : none;
}
A {
text-decoration : underline;
color: Black;
}
-->
</style>
</head>
<body bgcolor="#DDDDDD">
<br><br><br><br><br><br><br><br><br>
<div align="center"><font size="4"><b>Your request has been sent.</b></font>
</div>
</body>
</html>
|;
} <a href="$db_script_link_url&email=1" onMouseOver=" window.status='Points'; return true" onMouseOut="window.status=' '; return true"><img src="points.gif" border="0" width="150" height="150" alt="Image"></a>[/code]
This link is also the html.pl file.
Am i missing something?
The DB is set so each user only has one record.
But i'm getting the field names in the email but no actual data.
In the db.pl i have:
Code:
elsif ($in{'email'}) { &html_email; }
This is in the middle of all the other elsif statements.
In the default.cgi i have:
At the begining of the file after " require $db_script_path . "/html.pl";"
In the html.pl file i have:
Code:
sub html_email { # --------------------------------------------------------
# %rec=&get_record($in{$db_key});
#Send email to admin
open (MAIL, "$mailprog")or &cgierr("unable to open mail program");
print MAIL "To:$admin_email\n";
print MAIL "From:$admin_email\n";
print MAIL "Subject:Points request\n";
print MAIL "-" x 75 . "\n\n";
foreach $column(@db_cols){
print MAIL "$column:$rec{$column}\n";
}
print MAIL "Forename: $rec{'forename'}\n";
close MAIL;
&html_print_headers;
print qq|
<html>
<head>
<title>Test</title>
<style type="text/css"> <!--
A:hover {
color : Gray;
text-decoration : none;
}
A {
text-decoration : underline;
color: Black;
}
-->
</style>
</head>
<body bgcolor="#DDDDDD">
<br><br><br><br><br><br><br><br><br>
<div align="center"><font size="4"><b>Your request has been sent.</b></font>
</div>
</body>
</html>
|;
}
This link is also the html.pl file.
Am i missing something?

