Try repositioning bracket #2 so that it fits with bracket #3. Try putting it after the require statement. Or delete both of them.

ThirdThe 'else' at require(header.php) doesn't have a corresponding 'if', so you'll get an error about that. Now I don't know why you would make such a complicated logic nesting ending with an 'else' that loads what seems to be the header, when you also require the header at an other part in your code, there where the user validation fails. What I make of this is that you think that even if the validation fails or not the header will be loaded anyway. Require() doesn't work that way, it literary copies the content of the header.php. What you did is practically loaded header.php twice.Anyway that 'else' is trouble, get rid of it.