Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <?php
- //include config
- require_once('config.php');
- //check if already logged in move to home page
- if( $user->is_logged_in() ){ header('Location: lista_tematow.php'); }
- //process login form if submitted
- if(isset($_POST['submit'])){
- $username = $_POST['username'];
- $password = $_POST['password'];
- if($user->login($username,$password)){
- $_SESSION['username'] = $username;
- header('Location: lista_tematow.php');
- exit;
- } else {
- $error[] = 'Wrong username or password or your account has not been activated.';
- }
- }//end if submit
- //define page title
- //$title = 'Login';
- //include header template
- //require('layout/header.php');
- ?>
- <html>
- <head>
- <link rel="stylesheet" type="text/css" href="style.css">
- <title>Jokasta</title>
- <meta charset="UTF-8">
- <meta name="description" content="Jokasta">
- <meta name="keywords" content="Jokasta, Politechnika, Opolska, Opole">
- <meta name="author" content="Katarzyna Cybulska, Daniel Baranowski">
- <script src="http://code.jquery.com/jquery-1.12.4.js"></script>
- </head>
- <body>
- <div id="login">
- <h1 style="font-size: 80px; margin-top: 30vh;"><a href="index.php">Jokasta</a></h1>
- <!--<form class="form" action="logowanie.php" method="post">-->
- <form class="form" role="form" method="post" action="" autocomplete="off">
- <?php
- //check for any errors
- if(isset($error)){
- foreach($error as $error){
- echo '<p class="bg-danger">'.$error.'</p>';
- }
- }
- if(isset($_GET['action'])){
- //check the action
- switch ($_GET['action']) {
- case 'active':
- echo "<h2 class='bg-success'>Your account is now active you may now log in.</h2>";
- break;
- case 'reset':
- echo "<h2 class='bg-success'>Please check your inbox for a reset link.</h2>";
- break;
- case 'resetAccount':
- echo "<h2 class='bg-success'>Password changed, you may now login.</h2>";
- break;
- }
- }
- ?>
- <input type="text" name="username" id="username" placeholder="Login" value="<?php if(isset($error)){ echo $_POST['username']; } ?>"><br>
- <input type="password" name="password" id="password" placeholder="Hasło"><br>
- <input type="submit" name="submit" value="Zaloguj">
- </form>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement