Accessing Global Vars & Functions in custom php page

Adding the following code to the top of the PHP file will give you access to the WordPress functions and global variables.

<?php include_once($_SERVER['DOCUMENT_ROOT'].'/wp-load.php' );

You should then be able to run normal WordPress functions to determine whether or not the user is logged in:

<?php 
global $user_ID; 
get_currentuserinfo();
if ($user_ID) {
    // Do Something 
}
?>