Advertisement
shor7cut

Simple Login Passalt7

Dec 14th, 2015
594
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.88 KB | None | 0 0
  1. <?php
  2. error_reporting();
  3. session_start();
  4.  
  5. $password = "ec:550dfdef89bed03f550dfdef89bed03f"; // 123
  6.  
  7. function login($key,$password){
  8. $jum_key = strlen($key);
  9. $enc = md5($key);
  10. $jum_key = substr(md5($jum_key),0,2);
  11. $enc_1 = substr($enc, 18);
  12. $enc_2 = substr($enc, 0,17);
  13. $hasil = "$jum_key:".substr(md5($enc_1),0,16).substr(md5($enc_1),0,16);
  14. if($hasil==$password){
  15.     return true;
  16. }else{
  17.     return false;
  18. }
  19. }
  20.  
  21. if($_POST['Passalt7']){
  22.     $cek = login($_POST['password'],$password);
  23.     if($cek){
  24.         $_SESSION["login"]=$_POST['password'];
  25.         header('Location: ?');
  26.     }else{
  27.         echo "gagal";
  28.     }
  29. }
  30.  
  31. if(!isset($_SESSION["login"])){
  32. ?>
  33. <!DOCTYPE html>
  34. <html>
  35. <head>
  36.     <title>Login Page</title>
  37. </head>
  38. <body>
  39. <form action="" method="post">
  40.     <input type="text" name="password">
  41.     <input type="submit" name="Passalt7">
  42. </form>
  43. </body>
  44. </html>
  45. <?php
  46. }else{
  47.     echo "HALOOO";
  48. }
  49. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement