Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("src/databaseFunctions.php");
- include("src/loginFunctions.php");
- if (checkSession()) {
- header("Location: adminArtist.php");
- exit();
- }
- if (isset($_POST["login"])) {
- try {
- $db = myDBConnect();
- if (validateUser($db, $_POST["txtUserName"], $_POST["txtPassWord"]) === 1) {
- startSession();
- header("Location: adminArtist.php");
- exit();
- } else {
- throw new Exception("Felaktigt användarnamn och/eller lösenord!");
- }
- } catch(Exception $e) {
- $error = $e->getMessage();
- }
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8"/>
- <title> Musik </title>
- <link href="style/stilmall.css" rel="stylesheet" type="text/css"/>
- </head>
- <body>
- <?php
- if (isset($error)) {
- echo($error);
- }
- ?>
- <div id="wrapper">
- <header id="textheader">
- <h1> MusicSite</h1>
- </header>
- <div id="maincontent">
- <h2> Musiksida</h2>
- <!-- Knapparna vid sidan-->
- <nav id="nav">
- <ul style="list-style-type: none">
- <li>
- <form action="searchArtistSong.php" ><button id="button">Search</button></form>
- <form action="Index.php"> <button id="button2">Main Site</button></form>
- </li>
- </ul>
- </nav>
- <section id="content">
- <fieldset>
- <legend> Inloggningsuppgifter</legend>
- <br/>
- <form action="login.php" method="POST">
- <label >Användarnamn:</label> <br/>
- <input type="text" name="txtUserName" id="txtUserName" required="required">
- <br/>
- <label >Lösenord:</label><br/>
- <input type="password" name="txtPassWord" id="txtPassWord" required="required">
- <br/>
- <input type="submit" value="Login" id="login" name="login">
- <input type="reset" value="Reset" id="reset" name="reset"> <br/>
- <br/>
- </form>
- </fieldset>
- </section>
- </div>
- <footer>Skapad av Kevin</footer>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement