Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting();
- session_start();
- $password = "ec:550dfdef89bed03f550dfdef89bed03f"; // 123
- function login($key,$password){
- $jum_key = strlen($key);
- $enc = md5($key);
- $jum_key = substr(md5($jum_key),0,2);
- $enc_1 = substr($enc, 18);
- $enc_2 = substr($enc, 0,17);
- $hasil = "$jum_key:".substr(md5($enc_1),0,16).substr(md5($enc_1),0,16);
- if($hasil==$password){
- return true;
- }else{
- return false;
- }
- }
- if($_POST['Passalt7']){
- $cek = login($_POST['password'],$password);
- if($cek){
- $_SESSION["login"]=$_POST['password'];
- header('Location: ?');
- }else{
- echo "gagal";
- }
- }
- if(!isset($_SESSION["login"])){
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Login Page</title>
- </head>
- <body>
- <form action="" method="post">
- <input type="text" name="password">
- <input type="submit" name="Passalt7">
- </form>
- </body>
- </html>
- <?php
- }else{
- echo "HALOOO";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement