****code start****
if($_SESSION['myusername'] = NULL){
session_start();
}else{
echo "PLEASE LOGIN!";
}
****code end****

Basically, echo "PLEASE LOGIN!" works when someone is trying to access a page that they have to login for, but if someone DOES login, I get a load of errors!

At the moment, I've had to revert back to this

if (!isset($_SESSION)) {
session_start();
}

But I want to do it so that if someone is trying to access a page which requires a login (e.g.download area), the page will display "please login!"