query("SELECT COUNT(*) FROM students WHERE mnumber = $mnumber")->fetch(PDO::FETCH_NUM)[0] == 0) {
print '
';
print 'Mat.nummer not found |
---|
';
print '
';
}
else {
$userinfo = $db->query("SELECT firstname,lastname,email,password FROM students WHERE mnumber=$mnumber")->fetch(PDO::FETCH_NUM);
// send password-email //
$nachricht = "Hello $userinfo[0]($mnumber)!\nThis is a password-recovery mail for the exercise " . $PREFS['exname'] . " (" . $PREFS['groupname'] . ").\nYour forgotten password is: $userinfo[3]\n\nYours,\nBanana.";
$header = 'From: banana@treefish.org' . "\r\n" .
'Reply-To: noreply@treefish.org' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($userinfo[2], "Banana password-recovery: " . $PREFS['exname'] . " (" . $PREFS['groupname'] . ")", $nachricht, $header);
print "";
print "sent password to your email-address |
---|
";
print "
";
}
}
}
?>