Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_GET['action'])){
- $action = $_GET['action'];
- $actions = array('login', 'sercure');
- }else{
- $action = '';
- $actions = array('login', 'sercure');
- }
- if(!isset($action) || !in_array($action, $actions)){
- echo '<a href="index.php?action=login">Login</a>';
- }else{
- if($action == 'login'){
- echo '<form method="post" action="">
- <input type="text" name ="username" /><br />
- <input type="password" name="password" /><br />
- <input type="submit" name="login" value="Login!" />
- </form>';
- if(isset($_POST['login'])){
- $username = $_POST['username'];
- $password = md5(sha1($_POST['password']));
- if($username == 'admin' && $password == md5(sha1('wezBB'))){
- $_SESSION['isLogged'] == 'true';
- header('Location: index.php?action=sercure');
- die;
- }
- }
- }
- if($action == 'sercure'){
- if($_SESSION['isLogged'] == 'true'){
- echo 'Logged In!';
- }
- }
- }
Add Comment
Please, Sign In to add comment