2015-07-13 23:33:36 +02:00
|
|
|
<?php
|
|
|
|
|
session_start();
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
require_once ("config.php");
|
|
|
|
|
$verbindung = mysql_connect($dbhost, $dbuser , $dbpassword)
|
|
|
|
|
or die("Verbindung zur Datenbank konnte nicht hergestellt werden");
|
2015-07-14 14:11:49 +02:00
|
|
|
mysql_select_db($tableLOG) or die ("Datenbank konnte nicht ausgewählt werden");
|
2015-07-13 23:33:36 +02:00
|
|
|
|
|
|
|
|
$username = $_POST["username"];
|
|
|
|
|
$passwort = md5($_POST["password"]);
|
|
|
|
|
|
2015-07-14 14:11:49 +02:00
|
|
|
$abfrage = "SELECT username, passwort FROM" $tableLOG "WHERE username LIKE '$username' LIMIT 1";
|
2015-07-13 23:33:36 +02:00
|
|
|
$ergebnis = mysql_query($abfrage);
|
|
|
|
|
$row = mysql_fetch_object($ergebnis);
|
|
|
|
|
|
|
|
|
|
if($row->passwort == $passwort)
|
|
|
|
|
{
|
|
|
|
|
$_SESSION["username"] = $username;
|
|
|
|
|
header("Location: /show_pocsag.php");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
echo "Benutzername und/oder Passwort waren falsch. <a href=\"login.html\">Login</a>";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|