mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-04-08 16:03:38 +00:00
Enabling basic functionality
- removed deprecated functions (mysql) - adding function: select view at login - adapting queries to database structure - some minor stuff
This commit is contained in:
parent
1a9e2a34d1
commit
c02cd74586
7 changed files with 203 additions and 60 deletions
|
|
@ -4,25 +4,44 @@ session_start();
|
|||
|
||||
<?php
|
||||
require_once ("config.php");
|
||||
$verbindung = mysql_connect($dbhost, $dbuser , $dbpassword)
|
||||
$verbindung = mysqli_connect($dbhost, $dbuser , $dbpassword)
|
||||
or die("Verbindung zur Datenbank konnte nicht hergestellt werden");
|
||||
mysql_select_db($tableLOG) or die ("Datenbank konnte nicht ausgewählt werden");
|
||||
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;
|
||||
}
|
||||
|
||||
$username = $_POST["username"];
|
||||
$passwort = md5($_POST["password"]);
|
||||
|
||||
$abfrage = "SELECT username, passwort FROM" $tableLOG "WHERE username LIKE '$username' LIMIT 1";
|
||||
$ergebnis = mysql_query($abfrage);
|
||||
$row = mysql_fetch_object($ergebnis);
|
||||
|
||||
$abfrage = "SELECT username, passwort FROM ".$tableLOG." WHERE username LIKE '$username' LIMIT 1";
|
||||
$ergebnis = mysqli_query($verbindung, $abfrage);
|
||||
$row = mysqli_fetch_object($ergebnis);
|
||||
|
||||
if($row->passwort == $passwort)
|
||||
{
|
||||
$_SESSION["username"] = $username;
|
||||
header("Location: /show_pocsag.php");
|
||||
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");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Benutzername und/oder Passwort waren falsch. <a href=\"login.html\">Login</a>";
|
||||
echo "Benutzername und/oder Passwort waren falsch. <a href=\"index.php\">Login</a>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue