normally i include a file inc/init.inc in all my php files - it takes care of other includes and sets site-wide variables. for sites with logins i usually have a function, require_login(), which checks the session for a username and redirects the browser to the login page if it can't find one, passing the url of the current page to the login script so they can be redirected back upon successful login.
just write such a function and call it in your config or init script or make it's called on EVERY page. you should call the function before any of the code on your page is run and don't forget to call exit() after sending header('location: ...') to make sure the user cannot interact with the script if they are not logged in.
for me, there's never a risk of forgetting to call the function, cos it's in the init.inc script, without which nothing will work anyway.
inc files are protected by .htaccess files. if you need to prevent access to other files on the server, you can block direct access to the directory with .htaccess and serve the files via a php script (images.php?img=private.jpg) which includes your login check.