2015-07-13 23:33:36 +02:00
|
|
|
<?php
|
|
|
|
|
session_start();
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
require_once ("config.php");
|
2017-08-23 23:35:22 +02:00
|
|
|
$verbindung = mysqli_connect($dbhost, $dbuser , $dbpassword)
|
2015-07-13 23:33:36 +02:00
|
|
|
or die("Verbindung zur Datenbank konnte nicht hergestellt werden");
|
2017-08-23 23:35:22 +02:00
|
|
|
mysqli_select_db($verbindung, $database) or die ("Datenbank konnte nicht ausgewählt werden");
|
|
|
|
|
|
|
|
|
|
if (!isset($_POST["username"]) XOR !isset($_POST["password"]))
|
|
|
|
|
{
|
|
|
|
|
echo "Fehlende Eingaben - <a href='index.php'>Login</a>";
|
|
|
|
|
exit;
|
|
|
|
|
}
|
2015-07-13 23:33:36 +02:00
|
|
|
|
|
|
|
|
$username = $_POST["username"];
|
|
|
|
|
$passwort = md5($_POST["password"]);
|
|
|
|
|
|
2017-08-23 23:35:22 +02:00
|
|
|
|
|
|
|
|
$abfrage = "SELECT username, passwort FROM ".$tableLOG." WHERE username LIKE '$username' LIMIT 1";
|
|
|
|
|
$ergebnis = mysqli_query($verbindung, $abfrage);
|
|
|
|
|
$row = mysqli_fetch_object($ergebnis);
|
2015-07-13 23:33:36 +02:00
|
|
|
|
|
|
|
|
if($row->passwort == $passwort)
|
|
|
|
|
{
|
|
|
|
|
$_SESSION["username"] = $username;
|
2017-08-23 23:35:22 +02:00
|
|
|
switch ($_POST["view"]) {
|
|
|
|
|
case 'pocsag':
|
|
|
|
|
header("Location: show_pocsag.php");
|
|
|
|
|
break;
|
|
|
|
|
case 'zvei':
|
|
|
|
|
header("Location: show_zvei.php");
|
|
|
|
|
break;
|
|
|
|
|
case 'fms':
|
|
|
|
|
header("Location: show_fms.php");
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
header("Location: show_pocsag.php");
|
|
|
|
|
}
|
2015-07-13 23:33:36 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2017-08-23 23:35:22 +02:00
|
|
|
echo "Benutzername und/oder Passwort waren falsch. <a href=\"index.php\">Login</a>";
|
2015-07-13 23:33:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|