Fomulare multiple-Spalte, Admin Panel Auth angefangen
This commit is contained in:
20
admin/login.php
Executable file
20
admin/login.php
Executable 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);
|
||||
|
||||
Reference in New Issue
Block a user