Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. <?php
  2. if(isset($_SESSION['email'])):
  3. include('verifica_login.php');
  4. ?>
  5. <img id="char" src="IMAGENS/ICONES/char2.ico" alt=""> <br>
  6. <h2 style="color:white;font-size:13px">Olá, <?php echo $_SESSION['email'];
  7. ?></h2>
  8. <h2 style="color:white;font-size:13px"><a href="logout.php">Sair</a></h2>
  9. <?php
  10. endif;
  11. ?>
  12.  
  13. <?php
  14. session_start();
  15. include('coneccao.php');
  16.  
  17. if(empty($_POST['email']) || empty($_POST['senha'])){
  18. header('Location: HOME.php');
  19. exit();
  20.  
  21. }
  22.  
  23. $email = mysqli_real_escape_string($con, $_POST['email']);
  24. $senha = mysqli_real_escape_string($con, $_POST['senha']);
  25.  
  26. $query = ("select nome from usuario where email = '{$email}' and senha = md5('{$senha}')");
  27.  
  28. $result = mysqli_query($con,$query);
  29.  
  30. $row = mysqli_num_rows($result);
  31.  
  32. if($row == 1){
  33. $_SESSION['email'] = $email;
  34. header('Location: HOME.php');
  35. exit();
  36. }else{
  37. $_SESSION['nao_autenticado'] = true;
  38. header('Location: HOME.php');
  39. exit();
  40. }
  41.  
  42. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement