文件是 init.php,它包含在 user_settings.php 中
下面是代码
## init.php ##
<?php
session_start();
require 'database/connect.php';
require 'functions/users.php';
require 'functions/general.php';
if (logged_in() === true) {
$session_user_id = $_SESSION['user_id'];
$user_data = user_data($session_user_id, 'user_id', 'username', 'password', 'first_name', 'last_name', 'email');
}
$errors = array();
?>
和 user_setting.php
<?php
include 'core/init.php';
include 'includes/overall/header.php';
echo $user_data['first_name'];
include 'includes/overall/footer.php';
?>
我看不出我无法从 $user_data 回显的任何原因?
可能有更多经验的人将能够立即告诉!任何和所有的帮助将不胜感激!
瑞安