Last active
November 29, 2020 11:40
-
-
Save djoudi/de69561ea5ccfab84d665c6dbf3d83b1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <!-- Required meta tags --> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
| <link rel="stylesheet" href="../css/font-awesome.min.css" > | |
| <!-- Bootstrap CSS --> | |
| <link rel="stylesheet" href="../css/bootstrap.min.css" > | |
| <title></title> | |
| </head> | |
| <body> | |
| <div class="container mt-5"> | |
| <div class="row"> | |
| <div class="col"> | |
| <h2>404 Not found</h2> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Optional JavaScript --> | |
| <!-- jQuery first, then Popper.js, then Bootstrap JS --> | |
| <script src="../js/jquery-3.5.1.min.js" ></script> | |
| <script src="../js/popper.min.js" ></script> | |
| <script src="../js/bootstrap.min.js" ></script> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| session_start(); | |
| if (!isset($_SESSION['email'])) { | |
| header('Location:login.php'); | |
| } | |
| ?> | |
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <!-- Required meta tags --> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
| <link rel="stylesheet" href="../css/font-awesome.min.css" > | |
| <!-- Bootstrap CSS --> | |
| <link rel="stylesheet" href="../css/bootstrap.min.css" > | |
| <title></title> | |
| </head> | |
| <body> | |
| <div class="container mt-5"> | |
| <div class="row"> | |
| <div class="col"> | |
| <h2>Welcom To Admin</h2> | |
| <a href="logout.php" class="btn btn-danger btn-block">Logout</a> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Optional JavaScript --> | |
| <!-- jQuery first, then Popper.js, then Bootstrap JS --> | |
| <script src="../js/jquery-3.5.1.min.js" ></script> | |
| <script src="../js/popper.min.js" ></script> | |
| <script src="../js/bootstrap.min.js" ></script> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| session_start(); | |
| const EMAIL = '[email protected]'; | |
| const PASSWORD = '123456'; | |
| if ((isset($_POST['go'])&&($_POST['go']=='ok'))) { | |
| $email = (isset($_POST['email']))?$_POST['email']:NULL; | |
| $password = (isset($_POST['password']))?$_POST['password']:NULL; | |
| //$password = sha1(md5(sha1($password))); | |
| if ($email === EMAIL && $password == PASSWORD) { | |
| $_SESSION['email'] = $email; | |
| header('Location:admin.php'); | |
| //$_SESSION['cid'] = md5($email); | |
| }else{ | |
| header('Location:404.php'); | |
| } | |
| } | |
| ?> | |
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <!-- Required meta tags --> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
| <link rel="stylesheet" href="../css/font-awesome.min.css" > | |
| <!-- Bootstrap CSS --> | |
| <link rel="stylesheet" href="../css/bootstrap.min.css" > | |
| <title></title> | |
| </head> | |
| <body> | |
| <div class="container mt-5"> | |
| <div class="row"> | |
| <div class="col"> | |
| <form action="" method="post"> | |
| <div class="form-group"> | |
| <input type="email" name="email" class="form-control" placeholder="Enter email"> | |
| </div> | |
| <div class="form-group"> | |
| <input type="password" name="password" class="form-control" placeholder="Password"> | |
| </div> | |
| <input type="hidden" name="go" value="ok"> | |
| <button type="submit" class="btn btn-primary">Login</button> | |
| </form> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Optional JavaScript --> | |
| <!-- jQuery first, then Popper.js, then Bootstrap JS --> | |
| <script src="../js/jquery-3.5.1.min.js" ></script> | |
| <script src="../js/popper.min.js" ></script> | |
| <script src="../js/bootstrap.min.js" ></script> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| session_start(); | |
| if (!isset($_SESSION['email'])) { | |
| header('Location:login.php'); | |
| } | |
| unset($_SESSION['email']); | |
| session_destroy(); | |
| header('Location:login.php'); | |
| //setcookie('sssss','',time()-30*60*60*24); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment