douyi1963 2019-04-11 15:33 采纳率: 0%
浏览 34

如何在没有POST的情况下将值从页面传递到其他页面

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?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 怎么用dlib库的算法识别小麦病虫害
    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?
    • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算