I have a login, and if the credentials are correct it opens another PHP file and wanted the name of the person associated with the credentials used in the login to appear on a label. All information is stored in a database. How do I access the values stored in the first PHP file?
The login code is:
$email = mysqli_real_escape_string($dbconn, $_POST['login']);
$password = mysqli_real_escape_string($dbconn, $_POST['senha']);
if (!empty($email) && !empty($password))
{
$query = "SELECT email, password, id_paciente FROM Paciente WHERE email = '$email' AND password = '$password'";
$data = mysqli_query($dbconn, $query);
$result = mysqli_num_rows($data);
if ($result == 1)
{
$row = mysqli_fetch_array($data);
$_SESSION['id_paciente'] = $row['id_paciente'];
$_SESSION['nome'] = $row['nome'];
header("location: paciente_marcar_consulta_online.php");
}
And I wanted to pass the patient_id to the file "patient_marke_consult_online.php" in which the name of that patient_id was then presented. Can you help me?