You could just query the user table for the email addy as long as there is a field for it. You could add this:
After:
if ($message) { print qq|<font color="red">There was a problem: $message</font>|; }
print qq|
<$font>Fill in your email address, the subject of your email and the
message you wish to send to $Playername.</font>
|;
Add:
my $username_q = $DBH->quote($db_userid);
$query = qq!
SELECT Email FROM $db_table_user
WHERE username = $username_q
!;
my $sth = $DBH->prepare($query);
$sth->execute();
if ($sth->rows) {
while (@data = $sth->fetchrow_array) {
$email = $data[3]; # change to correct field number for email
}
}
$sth->finish;
Then replace:
<td><input type=text name="email" value="$in{'email'}" size=40></td></tr>
with:
<td><input type=hidden name="email" value="$email" size=40></td></tr>
I haven't tested this, but it should work without any other changes.
DBMan SQL Version 1 mods available at:
http://dbmansqlmods.rainbowroomies.com
(Mods based on JPDeni's original mods.)
After:
if ($message) { print qq|<font color="red">There was a problem: $message</font>|; }
print qq|
<$font>Fill in your email address, the subject of your email and the
message you wish to send to $Playername.</font>
|;
Add:
my $username_q = $DBH->quote($db_userid);
$query = qq!
SELECT Email FROM $db_table_user
WHERE username = $username_q
!;
my $sth = $DBH->prepare($query);
$sth->execute();
if ($sth->rows) {
while (@data = $sth->fetchrow_array) {
$email = $data[3]; # change to correct field number for email
}
}
$sth->finish;
Then replace:
<td><input type=text name="email" value="$in{'email'}" size=40></td></tr>
with:
<td><input type=hidden name="email" value="$email" size=40></td></tr>
I haven't tested this, but it should work without any other changes.
DBMan SQL Version 1 mods available at:
http://dbmansqlmods.rainbowroomies.com
(Mods based on JPDeni's original mods.)