Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.14 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title>demo form</title>
  5.     <link rel="stylesheet" href="css/style.css">
  6.     <!-- Latest compiled and minified CSS -->
  7.     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
  8.  
  9.     <!-- Optional theme -->
  10.     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
  11.  
  12.     <!-- Latest compiled and minified JavaScript -->
  13.     <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
  14.  
  15.  
  16. </head>
  17. <body>
  18.     <div class="container">
  19.         <div class="row">
  20.             <div class="col-md-6">
  21.             <form class="form-horizontal" name="formsubmit" method="post">
  22.               <div class="form-group">
  23.                 <label class="col-sm-2 control-label">User</label>
  24.                 <div class="col-sm-10">
  25.                   <input type="text" class="form-control" id="inputuser" placeholder="User" name="user">
  26.                 </div>
  27.               </div>
  28.  
  29.               <div class="form-group">
  30.                 <label for="inputPassword" class="col-sm-2 control-label">Password</label>
  31.                 <div class="col-sm-10">
  32.                   <input type="password" class="form-control" id="inputPassword" placeholder="Password" name="pass">
  33.                 </div>
  34.               </div>
  35.               <button type="submit" name="submit" class="btn btn-default">Submit</button>
  36.             </form>
  37.             </div>
  38.         </div>
  39.     </div>
  40.  
  41.  
  42. </body>
  43. </html>
  44. <?php
  45.      if (isset($_POST['submit'])) {
  46.         $admin = $_POST['user'];
  47.         $password = $_POST['pass'];
  48.  
  49.         if ($admin == 'admin' && $password == '123456') {
  50.             echo 'Chúc mừng bạn đăng nhập thành công';
  51.         }
  52.         else {
  53.             echo "Nhập lại đi, sai rồi. hehe";
  54.         }
  55.      }
  56.  
  57.  
  58. /*
  59.     - Nhâp user, pass.
  60.     - xử lý:     + Nếu user : admin và pass: 123456.  
  61.                 + nếu khác                              
  62.     - xuất        ......
  63.  
  64. */
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement