Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- VEJA O VÍDEO E APRENDA A FAZER, É BEM MELHOR QUE COPIAR E COLAR...
- Mas se quiser:
- login.php:
- <?php
- if($_SERVER['REQUEST_METHOD'] == 'POST'){
- $user = $_POST["username"];
- $pass = $_POST["password"];
- if($user == "demo" && $pass == "demo"){
- session_start();
- $_SESSION['login'] = $user;
- header('location: index.php');
- setcookie('logado', 'sim', (time() + 3600));
- }else{
- echo "Login incorreto";
- }
- }
- ?>
- <style>
- .text{
- color: red;
- }
- .pass{
- color: blue;
- }
- </style>
- <html>
- <class="login" align="center">
- <form method="POST">
- <input class="text" type="text" name="username" placeholder="Usuário" id="username">
- <p>
- <input class="pass" type="password" name="password" placeholder="Senha" id="password">
- <p>
- <input class="button" type="submit" value="Logar">
- </form>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement