Advertisement
harrisonmk

home

Sep 23rd, 2019
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. <?php
  2. //conexao
  3. require_once 'db_connect.php';
  4.  
  5. //sessao
  6. session_start();
  7.  
  8. //verificacao
  9. if(!isset($_SESSION['logado'])):
  10.     header('Location: index.php');
  11. endif;
  12.  
  13. //dados
  14. $id = $_SESSION['id_usuario'];
  15. $sql = "SELECT * FROM usuarios WHERE id = '$id'";
  16. $resultado = mysqli_query($connect, $sql);        
  17. $dados = mysqli_fetch_array($resultado);
  18. mysqli_close($connect);
  19. ?>
  20.  
  21. <!DOCTYPE html>
  22.  
  23. <html>
  24.     <head>
  25.         <meta charset="UTF-8">
  26.         <title></title>
  27.     </head>
  28.     <body>
  29.        
  30.        
  31.         <h1>Olรก: <?php echo $dados['nome']; ?></h1>
  32.         <a href="logout.php">Sair</a>
  33.        
  34.         <?php
  35.        
  36.         ?>
  37.     </body>
  38. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement