I think what you can do is to actually protect the html text itself, something like page permissions.
This is how i did it.
====================================
<?php
require ("required_include_file.inc.php");
is_authorized = require_login("<permission_lvl>");
if (!is_authorized) {
echo "Sorry you dont have permission to access this page.";
exit;
}
?>
<contimue with the html page>
The function require_login needs to verify if user is logged in, and takes an argument which is the page permission level and check if user has the appropriate permission and returns true or false appropriately.
You can do something different depending on your requirenment and conditions. Hope this helps