Advertisement
Guest User

Untitled

a guest
Dec 9th, 2018
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.82 KB | None | 0 0
  1. VEJA O VÍDEO E APRENDA A FAZER, É BEM MELHOR QUE COPIAR E COLAR...
  2. Mas se quiser:
  3.  
  4. login.php:
  5.  
  6. <?php
  7. if($_SERVER['REQUEST_METHOD'] == 'POST'){
  8.     $user = $_POST["username"];
  9.     $pass = $_POST["password"];
  10.    
  11.     if($user == "demo" && $pass == "demo"){
  12.         session_start();
  13.         $_SESSION['login'] = $user;
  14.         header('location: index.php');
  15.         setcookie('logado', 'sim', (time() + 3600));
  16.     }else{
  17.         echo "Login incorreto";
  18.     }
  19. }
  20.  
  21. ?>
  22.  
  23. <style>
  24. .text{
  25.     color: red;
  26. }
  27.  
  28. .pass{
  29.     color: blue;
  30. }
  31. </style>
  32.  
  33. <html>
  34.  
  35. <class="login" align="center">
  36. <form method="POST">
  37.     <input class="text" type="text" name="username" placeholder="Usuário" id="username">
  38.     <p>
  39.     <input class="pass" type="password" name="password" placeholder="Senha" id="password">
  40.     <p>
  41.     <input class="button" type="submit" value="Logar">
  42.     </form>
  43. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement