Hi. I can't understand why this don't work. First i have a function like this where the user name shows up:
if(isset($_POST['Commit'])){
if(empty($_POST['crime'])){
echo "You didn't select the type of crime you wish to do.";
}else{
(...lots of code)
$name = $_SESSION['username'];`
Then I have another function where the username shows up blank:
if(isset($_POST['action'])){
(...)
if(empty($_POST['car'])){
echo "You didn't select a car.";
}else{
if($row['owner'] != $_SESSION['username']){
echo "This isn't your car.";
}else{
There is allot of code that i didn't post, but you guys get the idea. Why does this happen? i thought $_SESSION was global and always available
My main php file look something like this:
require("php functions\page_functions.php");
require("php functions\gta_functions.php");
session_start();
class gtapage extends Page
{
public function display()
{
displayGta();
}
}
where displayGta(); is the function from my first post