X-Git-Url: https://git.treefish.org/banana.git/blobdiff_plain/2c45a56043747bc7b524cdff4d00ff925b1a9544..98bd1a7add3a56c08fb03293824e392b6d871613:/register.php?ds=inline diff --git a/register.php b/register.php index 69b99fe..e63872b 100644 --- a/register.php +++ b/register.php @@ -1,5 +1,8 @@ query("SELECT COUNT(*) FROM students WHERE mnumber = $mnumber")->fetch(PDO::FETCH_NUM)[0] == 1) { print ""; print ""; print "
user already registered
"; - break; + exit; } $db->query("INSERT INTO students (mnumber,firstname,lastname,email,password) @@ -30,20 +38,15 @@ if(isset($_POST['submit']) && $_POST['firstname']!="" && $_POST['lastname']!="" echo "$firstname $lastname was successfully registered.
"; // send password-email // - $lec_lines = file('var/lecture.txt'); - foreach ($lec_lines as $line_num => $line) { - $lecture[$line_num] = $line; - } - $nachricht = "Hello $firstname($mnumber)!\nYou registered for " . trim($lecture[0]) . " " . trim($lecture[1]) . ".\nRemember your password: $password\n\nYours,\nBanana."; - //$nachricht = wordwrap($nachricht,70); + $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: " . trim($lecture[0]) . " " . trim($lecture[1]), $nachricht, $header); + mail($email, "Banana Registration: " . $PREFS['exname'] . " (" . $PREFS['groupname'] . ")", $nachricht, $header); - break; + exit; } ?>