Skip to content
This repository was archived by the owner on Sep 23, 2022. It is now read-only.

Commit e7ece93

Browse files
authored
Initial Upload
1 parent d5b9f2f commit e7ece93

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

index.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<!-- Developed by NerdOfCode -->
2+
<!Doctype html>
3+
<?php
4+
session_start();
5+
?>
6+
<html>
7+
<head>
8+
<title>Custom Admin Panel</title>
9+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
10+
</head>
11+
<body>
12+
<h1>Custom Admin Panel</h1><hr>
13+
<form name="form" action="" method="post" >
14+
Username:&ensp;<input type="text" name="UID" id="UID" required><br>
15+
Password:&ensp; <input type="password" name="passwd" id="passwd" required><br>
16+
<input type="submit" value="Submit">
17+
</form>
18+
19+
20+
21+
</body>
22+
23+
<?php
24+
$user_name = $_POST['UID'];
25+
$user_password = $_POST['passwd'];
26+
$db = mysqli_connect('localhost', 'wp_user','skstsnbd18','custom') or die("Error connecting to MYSQL");
27+
$query = "SELECT password FROM users WHERE name = '$user_name'";
28+
mysqli_query($db, $query) or die("Unable to access MYSQL");
29+
$result = mysqli_query($db, $query);
30+
$row = mysqli_fetch_array($result);
31+
$password=$row['password'];
32+
if($user_password == $password && $user_name != ""){
33+
$_SESSION['status'] = "1";
34+
header("Location: /options.php");
35+
die();
36+
}else if($user_password != $password && $user_name != ""){
37+
echo "An error has occured... Please try again later";
38+
$_SESSION['status'] = "0";
39+
}
40+
41+
mysqli_close($db);
42+
43+
44+
45+
46+
?>
47+
48+
</html>

0 commit comments

Comments
 (0)