<?php
- function block($color, $text) {
- print "<table bgcolor=\" $color \">";
- print "<tr><th><b><font color=\"white\"> $text </font></b></th><tr>";
- print "</table>";
+ if( ! isset($COMMON_H)) {
+
+ $COMMON_H = 1;
+
+ function block($color, $text) {
+ print "<table bgcolor=\" $color \">";
+ print "<tr><th><b><font color=\"white\"> $text </font></b></th><tr>";
+ print "</table>";
+ }
+
}
?>
<?php
+
require 'db.inc';
+ require 'common.inc';
$mnumber = $_POST['mnumber'];
$password = $_POST['password'];
+ if(! is_numeric($mnumber)) {
+ block("red", "Matr.nummer has to be numeric!");
+ exit;
+ }
+
if($db->query("SELECT COUNT(*) FROM students WHERE mnumber = $mnumber")->fetch(PDO::FETCH_NUM)[0] == 0) {
print '<table bgcolor="red">';
print '<tr><th><b><font color="white">Mat.nummer not found</font></b></th><tr>';
<?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']!="")
$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 //