0
My login screen will lead to login_proc.php that starts the session. I want to pass to the reservation.php screen the user name. How to do this by passing the header or otherwise. Also, how do I get the value you pass in the.php booking.?
<?php
// Iniciar a $_SESSION
session_start();
require_once "conexao.php";
$usuario = filter_input(INPUT_POST,'usuario_nome', FILTER_SANITIZE_SPECIAL_CHARS);
$usuario = mysqli_real_escape_string($banco, $usuario);
$senha = filter_input(INPUT_POST,'senha', FILTER_SANITIZE_SPECIAL_CHARS);
$senha = password_hash($senha, PASSWORD_DEFAULT);
$sql = "SELECT id_usuario, usuario_nome, senha FROM usuario WHERE usuario_nome = '$usuario'";
$resultado = mysqli_query($banco, $sql);
$registro = mysqli_fetch_assoc($resultado);
@header ("location:reserva.php?usuario=$usuario");
I don’t understand what you want, and if it’s right, but to do what you want, try it this way:
@header("location:reserva.php?usuario=" . $usuario);
or@header("location:reserva.php?usuario={$usuario}");
– rbz