Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. <?php
  2. include("src/databaseFunctions.php");
  3. include("src/loginFunctions.php");
  4.  
  5. if (checkSession()) {
  6. header("Location: adminArtist.php");
  7. exit();
  8. }
  9.  
  10. if (isset($_POST["login"])) {
  11. try {
  12. $db = myDBConnect();
  13.  
  14. if (validateUser($db, $_POST["txtUserName"], $_POST["txtPassWord"]) === 1) {
  15. startSession();
  16. header("Location: adminArtist.php");
  17. exit();
  18. } else {
  19. throw new Exception("Felaktigt användarnamn och/eller lösenord!");
  20. }
  21. } catch(Exception $e) {
  22. $error = $e->getMessage();
  23. }
  24.  
  25. }
  26. ?>
  27.  
  28. <!DOCTYPE html>
  29. <html>
  30. <head>
  31. <meta charset="utf-8"/>
  32. <title> Musik </title>
  33. <link href="style/stilmall.css" rel="stylesheet" type="text/css"/>
  34. </head>
  35.  
  36. <body>
  37. <?php
  38. if (isset($error)) {
  39. echo($error);
  40. }
  41. ?>
  42. <div id="wrapper">
  43.  
  44. <header id="textheader">
  45. <h1> MusicSite</h1>
  46. </header>
  47.  
  48. <div id="maincontent">
  49. <h2> Musiksida</h2>
  50.  
  51. <!-- Knapparna vid sidan-->
  52. <nav id="nav">
  53. <ul style="list-style-type: none">
  54. <li>
  55.  
  56. <form action="searchArtistSong.php" ><button id="button">Search</button></form>
  57. <form action="Index.php"> <button id="button2">Main Site</button></form>
  58.  
  59. </li>
  60. </ul>
  61. </nav>
  62. <section id="content">
  63. <fieldset>
  64. <legend> Inloggningsuppgifter</legend>
  65. <br/>
  66. <form action="login.php" method="POST">
  67. <label >Användarnamn:</label> <br/>
  68. <input type="text" name="txtUserName" id="txtUserName" required="required">
  69. <br/>
  70. <label >Lösenord:</label><br/>
  71. <input type="password" name="txtPassWord" id="txtPassWord" required="required">
  72. <br/>
  73. <input type="submit" value="Login" id="login" name="login">
  74. <input type="reset" value="Reset" id="reset" name="reset"> <br/>
  75. <br/>
  76.  
  77. </form>
  78.  
  79.  
  80. </fieldset>
  81. </section>
  82.  
  83. </div>
  84.  
  85. <footer>Skapad av Kevin</footer>
  86. </div>
  87.  
  88. </body>
  89.  
  90. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement