Opening a link in a new window if logged in (v10)

Hi, I want to include a link to an external php script.I only want the external page to load if the user is logged in.I do not want any one to access the page directly by just entering the url.how do I sayIf user is logged into phpmaker files then “ok” ELSE "back to log in page"what are the paramaters that carry the info that the user is logged in?Thanks

I added this tot he top of my external php file:<?phpif (session_id() == "") session_start(); // Initialize Session data ob_start(); // Turn on output buffering ?>

<?php include_once "../ewcfg10.php" ?> <?php include_once "../ewmysql10.php" ?> <?php include_once "../phpfn10.php" ?> <?php include_once "../_Accessinfo.php" ?> <?php include_once "../userfn10.php" ?> <?php include_once "../ewshared10.php" ?> <?php if (CurrentUserName() <> "") { //echo CurrentUserName() ; } else { header("Location:LOGONURL");}?>Seems to have fixed it - anyone have a better solution?