Allow the execution of an external PHP script for logged users

I would do this the other way around:

if ( !is_user_logged_in () ) {
  //the script exits if the user is not logged in
  require('/path/to/your/script.php');
  showAccessDenied($day, $month, $year, $area, isset($room) ? $room : "");
}

You can work that into a page in a number of ways. I don’t have enough detail to provide an example that fits your needs.

error code: 523