This repository was archived by the owner on Sep 23, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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: <input type="text" name="UID" id="UID" required><br>
15+ Password:  <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>
You can’t perform that action at this time.
0 commit comments