Im trying to pass a value from one page to another by using PHP. I have a session file that have the all variables but i can´t pass one of them and I don´t know why. I´m passing some values from a foreach too because the page its a "change" or an "edit" page to some players from a game. My first page where I have the name is this one: https://imgur.com/a/GlpzVvF The code of this page is (the part that I want to pass to the other page is the variable "nome" on the H2 -> inside the body):
<!DOCTYPE html>
<?php
//Este ficheiro, APÓS LOGIN (autenticação) com sucesso; apresentará uma página de boas-vindas
include ('session.php');
?>
<html >
<head>
<title>DSE | Menu</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/style_welcome.css">
<link rel="shortcut icon" href="imagens/favicon.ico" />
<!-- CSS para a tabela com pesquisa funcionar -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/dataTables.bootstrap.min.css">
<link rel="stylesheet" href="css/jquery.dataTables.min.css">
<link rel="stylesheet" href="css/buttons.dataTables.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
</head>
<body>
<nav class="menu" tabindex="0">
<div class="smartphone-menu-trigger"></div>
<header class="avatar">
<img src="imagens/LOGO_DSE.png" />
<!-- Apresenta o nome do user após o login -->
<h2>Bem-vindo(a), <?php echo $nome;?>!</h2>
</header>
The page that I want it to appear is this one: https://imgur.com/a/C68lQpN The code of the page is:
<?php
include "functions.php";
$idutente=$_GET ['id'];
$nome=$nome;
$tasks = DBRead3($idutente);
foreach($tasks as $cl)
{
$cl_nome=$cl['nome'];
$cl_data_nascimento=$cl['data_nascimento'];
$cl_peso=$cl['peso'];
$cl_altura=$cl['altura'];
$cl_tipo_sangue=$cl['tipo_sangue'];
$cl_alergias=$cl['alergias'];
$cl_doencas=$cl['doencas'];
$cl_telefone=$cl['telefone'];
$cl_morada=$cl['morada'];
$cl_notas=$cl['notas'];
$cl_seguro=$cl['seguro'];
$cl_identificador=$cl['identificador'];
} ?>
<html >
<head>
<title>DSE | Menu</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/style_welcome.css">
<link rel="shortcut icon" href="imagens/favicon.ico" />
<!-- CSS para a tabela com pesquisa funcionar -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/dataTables.bootstrap.min.css">
<link rel="stylesheet" href="css/jquery.dataTables.min.css">
<link rel="stylesheet" href="css/buttons.dataTables.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
</head>
<body>
<nav class="menu" tabindex="0">
<div class="smartphone-menu-trigger"></div>
<header class="avatar">
<img src="imagens/LOGO_DSE.png" />
<!-- Apresenta o nome do user após o login -->
<h2>Bem-vindo(a), <?php echo $nome;?>!</h2>
</header>
I´m calling the value on the top of the page, and using it again on the body inside the H2 tag, but it´s not working. The foreach here is to call the variables that i want to be edited... Does anyone know how to help me?