Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = "locahost";
- $user = "crcom758_mark";
- $pass = "ascacibas";
- $banco = "crcom758_marketing";
- $conexao = mysql_connect($host, $user, $pass) or die(mysql_error());
- mysql_select_db($banco) or die (mysql_error());
- ?>
- <html>
- <head>
- <title></title>
- <script type="text/javascript">
- function loginsuccessfully() {
- setTimeout("window.location='painel.php'", 5000);
- }
- function loginfailed(){
- setTimeout ("window.location='index.php'", 5000);
- }
- </head>
- <body>
- <?php
- $email = $_POST['Email'];
- $senha = $_POST['Senha'];
- $slc = mysql_query ("SELECT * FROM usuarios WHERE email = '$email' and senha = '$senha' ") or die (mysql_error());
- $row = mysql_num_rows($sql);
- if($row > 0) {
- session_start();
- $_SESSION['email']=$_POST['email'];
- $_SESSION['senha']=$_POST['senha'];
- echo "Você foi autenticado com sucesso!";
- echo "<script>loginsuccessfully()</script>";
- }else {
- echo "Nome de usuário ou senha inválidos!";
- echo "<script>loginfailed()</script>";
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement