/************************************************\
* This code replicates the headers that were     *
* sent when the class connected to the url.      *
*                                                *
* FIXME: extra headers need to be sent if we are *
* downloading the file.                          *
*                                                *
* GOTCHA?: need to check if http 1.1 will work   *
* correctly                                      *
\************************************************/
//foreach($head as $h) header($h);
/************************************************\
* This block of code displays the page to the    *
* user.                                          *
*                                                *
* Note: Both processPageData and getRawPageData  *
* close the connection to the URL when they      *
* return.  You must re-open a connection with    *
* openLink to use them again.                    *
\************************************************/
if ($isHtml) {
    $page->processPageData();
    if ($encryptPage) {
        $page->encryptPage();
    }
    echo $page->getPageData();
} else {
    if ($isImage) {
        $page->getRawPageData();
    }
}