Fomulare multiple-Spalte, Admin Panel Auth angefangen

This commit is contained in:
R40fendt
2026-01-03 19:49:22 +01:00
parent 53ce8a4491
commit a7cad8edca
4 changed files with 55 additions and 3 deletions

20
admin/login.php Executable file
View File

@@ -0,0 +1,20 @@
<?php
include("../../mysqlverbinden.php");
if(!isset($_GET["username"])) die("GET username fehlt");
$username=$_GET["username"];
if(!isset($_GET["password"])) die("GET password fehlt");
$password=$_GET["password"];
$result=mysqli_execute_query($db_id,"SELECT `password` FROM `adminpanel-users` WHERE `username`=?;",[$username])->fetch_assoc();
if(!isset($result["password"]))
die('{"error":"Falscher Benutzername","success":false}');
if($result["password"]!=$password)
die('{"error":"Falsches Passwort","success":false}');
$token="";
echo json_encode(["token"=>$token,"success"=>true],JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);