mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-04-07 07:23:38 +00:00
move www-dir to exampleAddOns
This commit is contained in:
parent
beb955567f
commit
ad88f65d0b
70 changed files with 0 additions and 0 deletions
58
exampleAddOns/alarmMonitorWeb/eintragen.php
Normal file
58
exampleAddOns/alarmMonitorWeb/eintragen.php
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
|
||||
<?php
|
||||
session_start();
|
||||
?>
|
||||
|
||||
<?php
|
||||
if(($_SESSION["username"])!="Kevin")
|
||||
{
|
||||
echo "Sie sind nicht berechtigt fuer diesen Bereich";
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
$verbindung = mysql_connect("localhost", "root" , "kevin21")
|
||||
or die("Verbindung zur Datenbank konnte nicht hergestellt werden");
|
||||
|
||||
mysql_select_db("login") or die ("Datenbank konnte nicht ausgewählt werden");
|
||||
|
||||
$username = $_POST["username"];
|
||||
$passwort = $_POST["passwort"];
|
||||
$passwort2 = $_POST["passwort2"];
|
||||
|
||||
if($passwort != $passwort2 OR $username == "" OR $passwort == "")
|
||||
{
|
||||
echo "Eingabefehler. Bitte alle Felder korekt ausfüllen. <a href=\"eintragen.html\">Zurück</a>";
|
||||
exit;
|
||||
}
|
||||
$passwort = md5($passwort);
|
||||
|
||||
$result = mysql_query("SELECT id FROM login WHERE username LIKE '$username'");
|
||||
$menge = mysql_num_rows($result);
|
||||
|
||||
if($menge == 0)
|
||||
{
|
||||
$eintrag = "INSERT INTO login (username, passwort) VALUES ('$username', '$passwort')";
|
||||
$eintragen = mysql_query($eintrag);
|
||||
|
||||
if($eintragen == true)
|
||||
{
|
||||
echo "Benutzername <b>$username</b> wurde erstellt. <a href=\"login.html\">Login</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Fehler beim Speichern des Benutzernames. <a href=\"eintragen.html\">Zurück</a>";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
echo "Benutzername schon vorhanden. <a href=\"eintragen.html\">Zurück</a>";
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue