任何人都可以帮助我解决我所处的情况。我一直在尝试从存储了信息的表中找到有关如何显示用户的名字、姓氏电子邮件...等的答案,但我唯一的运气是回显此信息仅获取某种感觉的所有信息,以显示所有电子邮件,而不是仅针对用户的 1 封特定电子邮件,否则我最终会遇到 mysql 错误。
这是我的 index.php 源
<?php
session_start();
if (isset($_SESSION['id'])) {
// Put stored session variables into local php variable
$userid = $_SESSION['id'];
$email = $_SESSION['email'];
$firstname = $_SESSION['first_name'];
$lastname = $_SESSION['last_name'];
$businessname = $_SESSION['company_name'];
$country = $_SESSION['country'];
$plan = $_SESSION['plan'];
} else {
header("Location: http://somewebsite.com");
}
include 'connect.php';
$first_name = $_GET['first_name'];
$last_name = $_GET['last_name'];
?>
例如,我想在标题中回显用户的名字
<span class="username">USER</span> <--replace user with logged in user's firstname n last name-->