Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LOGIN.PHP
- <?php
- $user = $_GET['user'];
- $pass = $_GET['pass'];
- include("bd.php");
- if($valida[$user]==$pass){
- setcookie("logado", "1");
- echo "<script>location.href='main.php?usuario='$user</script>";
- }
- else{
- echo "<font face=verdana size=2>";
- echo "Usuário ou senha incorretos!";
- echo "<br>";
- echo "<a href=login.html>";
- echo "Clique aqui</a> para tentar novamente.";
- echo "</a></font>";
- }
- ?>
- MAIN.PHP
- <?php
- if(IsSet($_COOKIE["logado"])){}
- else{
- echo '<meta http-equiv="refresh" content="0;url=login.html">';
- exit;
- }
- ?>
- <html>
- <head>
- <title>Sistema de usuários</title>
- </head>
- <body>
- <font face="Verdana" size="2">
- <br><br> <a href="logout.php">Sair (finalizar) (logout)</a>
- </font>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement