query("SELECT COUNT(*) FROM students WHERE mnumber = $mnumber")->fetch(PDO::FETCH_NUM)[0] == 1) {
print "
";
print "user already registered |
---|
";
print "
";
break;
}
$db->query("INSERT INTO students (mnumber,firstname,lastname,email,password)
VALUES (\"$mnumber\",\"$firstname\",\"$lastname\",\"$email\",\"$password\")");
print "";
print "registration successfull |
---|
";
print "
";
echo "$firstname $lastname was successfully registered.
";
// send password-email //
$nachricht = "Hello $firstname($mnumber)!\nYou registered for " . $PREFS['exname'] . " (" . $PREFS['groupname'] . ").\nRemember your password: $password\n\nYours,\nBanana.";
$empfaenger = 'niemand@example.com';
$betreff = 'Der Betreff';
$header = 'From: banana@treefish.org' . "\r\n" .
'Reply-To: noreply@treefish.org' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($email, "Banana Registration: " . $PREFS['exname'] . " (" . $PREFS['groupname'] . ")", $nachricht, $header);
break;
}
?>