Guest User

Untitled

a guest
Feb 14th, 2018
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.01 KB | None | 0 0
  1. <?php
  2. session_start();
  3. // ini_set('display_errors', 1);
  4. // ini_set('display_startup_errors', 1);
  5. // error_reporting(E_ALL);
  6.     error_reporting(0);
  7.  
  8.     echo "@post username: " , $_POST['username'] , "</br>";
  9.     echo "@post password: " , $_POST['password'] , "</br>";
  10.     echo "@post code    : " , $_POST['code'] , "</br>";
  11.     echo var_dump($_POST['username']), $_POST['username'];
  12.     if (@$_POST['username'] and @$_POST['password'] and @$_POST['code'])
  13.     {
  14.  
  15.         $username = (string)$_POST['username'];
  16.         $password = (string)$_POST['password'];
  17.         $code     = (string)$_POST['code'];
  18.         echo "casted username: " , $username , "</br>";
  19.         echo "casted password: " , $password , "</br>";
  20.         echo "casted code    : " , $code , "</br>";
  21.         echo "md5 username: " , md5($username) , "</br>";
  22.         echo "md5 password: " , md5($password) , "</br>";
  23.         echo "md5 code    : " , md5($code) , "</br>";
  24.     if (($username == $password ) or ($username == $code)  or ($password == $code)) {
  25.            
  26.             echo 'Your input can not be the same.';
  27.  
  28.         } else if ((md5($username) === md5($password) ) and (md5($password) === md5($code)) ) {
  29.             $_SESSION["secret"] = '133720';
  30.             header('Location: admin.php');  
  31.             exit();
  32.  
  33.         } else {
  34.  
  35.             echo "<pre> Invalid password </pre>";
  36.         }
  37.     }else{
  38.    
  39.     echo "null imputs";
  40.  
  41.     }
  42.  
  43.  
  44. ?>
  45.  
  46. <html >                                                                                                                  
  47.   <head>                                                                                                                
  48.                                                                                                                  
  49.     <meta charset="UTF-8">                                                                                              
  50.     <title>Secure Login - Homeless</title>    
  51.     <link href="css/bootstrap.min.css" rel="stylesheet">                                                                                
  52.  
  53. </head>                                                                                                                
  54.                                                                                                                          
  55.   <body>                                                                                                                
  56.                                                                                                                          
  57.     <div class="container">    
  58.         <div id="loginbox" style="margin-top:50px;" class="mainbox col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">                    
  59.             <div class="panel panel-info" >
  60.                     <div class="panel-heading">
  61.                         <div class="panel-title">Sign In</div>
  62.                         <div style="float:right; font-size: 80%; position: relative; top:-10px"><a href="index.phps">Need Hint?</a></div>
  63.                     </div>    
  64.  
  65.                     <div style="padding-top:30px" class="panel-body" >
  66.  
  67.                         <div style="display:none" id="login-alert" class="alert alert-danger col-sm-12"></div>
  68.                            
  69.                         <form id="loginform" class="form-horizontal" role="form" method="post" action="">
  70.                                                                    
  71.                             <div style="margin-bottom: 25px" class="input-group">
  72.                                         <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
  73.                                         <input id="login-username" type="text" class="form-control" name="username" value="" placeholder="username" autocomplete="off">                                        
  74.                                     </div>
  75.                                
  76.                             <div style="margin-bottom: 25px" class="input-group">
  77.                                         <span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
  78.                                         <input id="login-password" type="password" class="form-control" name="password" placeholder="password" autocomplete="off">
  79.                                     </div>
  80.              
  81.                             <div style="margin-bottom: 25px" class="input-group">
  82.                                         <span class="input-group-addon"><i class="glyphicon glyphicon-qrcode"></i></span>
  83.                                         <input id="login-username" type="text" class="form-control" name="code" value="" placeholder="secret code" autocomplete="off">                                        
  84.                                     </div>
  85.                      
  86.  
  87.                                
  88.                             <div class="input-group">
  89.                                       <div class="checkbox">
  90.                                         <label>
  91.                                           <input id="login-remember" type="checkbox" name="remember" value="1"> Remember me
  92.                                         </label>
  93.                                       </div>
  94.                                     </div>
  95.  
  96.  
  97.                                 <div style="margin-top:10px" class="form-group">
  98.                                     <div class="col-sm-12 controls">
  99.                                       <input type="submit" name="login" value="Login"  class="btn btn-success"/>
  100.                                     </div>
  101.                                 </div>
  102.  
  103.                    
  104.                          </form>  
  105.  
  106.  
  107.                         </div>                    
  108.                     </div>  
  109.         </div>
  110.    
  111.     </div>  
  112.     <script src="js/jquery.min.js"></script>
  113.     <script src="js/bootstrap.min.js"></script>      
  114.   </body>                                                                                                                
  115. </html>
Add Comment
Please, Sign In to add comment