files are init.php which is included in user_settings.php
below is the code
## 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();
?>
and user_setting.php
<?php
include 'core/init.php';
include 'includes/overall/header.php';
echo $user_data['first_name'];
include 'includes/overall/footer.php';
?>
I can’t see any reason why I cannot echo from the $user_data?
probably someone with more experience will be able to tell straight away! any and all help will be greatly appreciated!
Ryan
you can Try this one
1) First remove “## init.php ##” in the top of init.php file. Since, No string even space should not be there before session_start() function
2) check user_data() function, that return the expected data’s.