Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. \this is the admin login///
  2.  
  3. <?php
  4. session_start();
  5. include '/conn.php';
  6. ?>
  7.  
  8. <head>
  9.  
  10. <title>Reservation portal | Admin Login</title>
  11. <link href="/booking/css/styling.css" rel="stylesheet" type="text/css">
  12. </head>
  13. <body>
  14.  
  15. <div class="mobile-screen">
  16. <div class="header">
  17. <h1>Log in</h1>
  18. <h3>Admin</h3>
  19. </div>
  20.  
  21. <ul class="nav">
  22. <li><a href="/booking/index.php">User</a></li>
  23. <li><a>Admin</a></li>
  24. </ul>
  25.  
  26. <!-- <div class="logo"> <img src="images/epic.png" alt="image"/></div>-->
  27.  
  28. <!-- Log In form -->
  29. <form id="login-form" role="form" action="adminLogin.php" method="post">
  30.  
  31. <select id="UserName" name="UserName" placeholder="Username" required>
  32. <option value="" style="background: darkgrey; " ></option>
  33. <?php
  34. $sqlUser = "SELECT * FROM admin ORDER BY UserName DESC";
  35. $radmin = mysql_query($sqlUser);
  36.  
  37. while ( ( $rowAdm = mysql_fetch_array($radmin) ) != false ) {
  38. ?>
  39. <option style="background-color: rgba(255,255,255,0.3);" value="<?php echo $rowAdm['UserName']; ?>">
  40. <?php echo $rowAdm['UserName']; ?></option>
  41.  
  42. <?php } // close while ?>
  43.  
  44. </select>
  45. <input type="password" name="password" placeholder="Password">
  46. <input type="submit" value="Log In" name="Alogin" class="login-btn button">
  47. </form>
  48.  
  49. </div>
  50.  
  51. </body>
  52.  
  53. \This is the connection///
  54.  
  55. <?php
  56. // DB credentials.
  57. define('DB_HOST','localhost');
  58. define('DB_USER','root');
  59. define('DB_PASS','');
  60. define('DB_NAME','reservationdb');
  61. // Establish database connection.
  62. try
  63. {
  64. $dbh = new PDO("mysql:host=".DB_HOST.";dbname=".DB_NAME,DB_USER, DB_PASS,array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"));
  65. }
  66. catch (PDOException $e)
  67. {
  68. exit("Error: " . $e->getMessage());
  69. }
  70. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement