Victor,
At a guess your include file contains HTML and the HTML for the page has already been written.
Can you , upon return from the function, add the following code to the HTML where the function returns a boolean, $good_password:
<?php
if($good_password)
include("footer.php);
<?