Advertisement
mvsp

Aula 41 - home.php

Jul 6th, 2021
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.55 KB | None | 0 0
  1. <?php
  2. //Conexão
  3. require_once 'db_connect.php';
  4. // Sessão
  5. session_start();
  6.  
  7. //Verificação
  8. if(!isset($_SESSION['logado'])):
  9.     header('Location: index.php');
  10. endif;
  11.  
  12. //Dados
  13. $id = $_SESSION['id_usuario'];
  14. $sql = "SELECT * FROM usuarios WHERE id = '$id' ";
  15. $resultado = mysqli_query($connect,$sql);
  16. $dados = mysqli_fetch_array($resultado);
  17. mysqli_close($connect);
  18. ?>
  19.  
  20. <html>
  21. <head>
  22.     <title>Login</title>
  23.     <meta charset="utf-8">
  24. </head>
  25. <body>
  26. <h1>  Olá <?php echo  $dados['nome']?></h1>
  27. <a href="logout.php">Sair</a>
  28. </body>
  29.  
  30. <html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement