So in 'index.php' the user puts their username and password into HTML inputs and it saves them to '$username' and '$password'. Then the PHP says:
<?php
$loginquery = mysqli_query($connection,"SELECT * FROM users WHERE username = '$username' AND password = '$password'");
$user = mysqli_fetch_array($loginquery);
session_start();
$_SESSION['username'] = $user['username'];
echo $_SESSION['username'];
?>
It echo's out '$_SESSION['username']' alright but if I then go to 'home.php' it hasn't actually saved the variable and it says 'Notice: Undefined variable: _SESSION in /Applications/XAMPP/xamppfiles/htdocs/tobyscott/home.php on line 24'
This is REALLY bugging me! Thanks :)