Gossamer Forum
Home : Products : DBMan : Customization :

no data on email to admin :/

Quote Reply
no data on email to admin :/
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:

Code:


elsif ($in{'email'}) { &html_email; }


This is in the middle of all the other elsif statements.

In the default.cgi i have:

Code:


$mailprog = "|/usr/lib/sendmail -t";
$admin_email = 'stevens@e-mail.dk';


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>
|;
}
<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?
Quote Reply
Re: [manic] no data on email to admin :/ In reply to
I believe you need to keep this line of code uncommented within your sub:

# %rec=&get_record($in{$db_key});

Also the link to the sub should perhaps look more like this:

<A HREF="$db_script_link_url&$db_key=$rec{$db_key}&email=1">

and placed somewhere within the record.

Hope this helps

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/
Quote Reply
Re: [LoisC] no data on email to admin :/ In reply to
In Reply To:
I believe you need to keep this line of code uncommented within your sub:

# %rec=&get_record($in{$db_key});

Also the link to the sub should perhaps look more like this:

<A HREF="$db_script_link_url&$db_key=$rec{$db_key}&email=1">

and placed somewhere within the record.

Hope this helps


The line %rec=&get_record($in{$db_key}); wasnt actually commented, it was an error on my part. I should've proof read the code.
Quote Reply
Re: [manic] no data on email to admin :/ In reply to
Just tried the new link, and it works.

Thanks!!! Smile