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 
}
?>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)