Instead of saying things like
if (!$_SESSION['user']) {
, you should be using something like:
if (!empty($_SESSION['user'])) {
Even if you were trying to compare them to NULL, '=' isn't a comparison operator. Look at this man page to see what comparison operators are: [man]language.operators.comparison[/man].
The ' = NULL' bit is outside of the ending ')' of the if() statement.
Of course, after following point #1, #'s 2 and 3 will become rather moot - I only mention them to help you improve your coding methods in general.
EDIT: Also, when posting PHP code, please use the board's [PHP][/PHP] bbcode tags - they make the code much, much easier to read (as well as aiding the diagnosis of syntax errors).