]> git.treefish.org Git - banana.git/blobdiff - register.php
improved blackboard submits.
[banana.git] / register.php
index 13e2aaba5ceeb5dae2ecaf3c94ed3171d17e5630..e63872b2e6a4f833d8ccac036198cbd24e4ae92e 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 require 'include/head.inc';
 require 'include/prefs.inc';
+require 'include/common.inc';
+
 
 if(isset($_POST['submit']) && $_POST['firstname']!="" && $_POST['lastname']!="" 
                           && $_POST['mnumber']!="" && $_POST['email']!="" && $_POST['password']!="")
@@ -11,6 +13,11 @@ if(isset($_POST['submit']) && $_POST['firstname']!="" && $_POST['lastname']!=""
   $email = $_POST['email'];
   $password = $_POST['password'];
 
+  if( ! is_numeric($mnumber) ) {
+    block("red", "Mat.nummer has to be numeric!");
+    exit;
+  }
+
   require 'include/db.inc';
 
   // user already exists //
@@ -18,7 +25,7 @@ if(isset($_POST['submit']) && $_POST['firstname']!="" && $_POST['lastname']!=""
     print "<table bgcolor=\"red\">";
       print "<tr><th><b><font color=\"white\">user already registered</font></b></th><tr>";
     print "</table>";
-    break;
+    exit;
   }
 
   $db->query("INSERT INTO students (mnumber,firstname,lastname,email,password) 
@@ -39,7 +46,7 @@ if(isset($_POST['submit']) && $_POST['firstname']!="" && $_POST['lastname']!=""
     'X-Mailer: PHP/' . phpversion();
   mail($email, "Banana Registration: " . $PREFS['exname'] . " (" . $PREFS['groupname'] . ")", $nachricht, $header);
 
-  break;
+  exit;
 }
 ?>