Exemplo n.º 1
0
$relDir = eregi_replace("/[^/]*\$", "/", $relDir);
/************************************************\
* We create a new object of type WebPage and     *
* pass it the url we are being a proxy for and   *
* other information about the current state.     *
\************************************************/
$page = new WebPage($redirectIP . $_GET[$fileVar], true, $server, "URLproxyServer.php", $fileVar, $relDir);
/************************************************\
* This tells the WebPage object to open up a     *
* connection to the URL.                         *
*                                                *
* Note:                                          *
* This does not actually get the web page, just  *
* opens the connection for the headers.          *
\************************************************/
$page->openLink();
/************************************************\
* Process the headers so we know what kind of    *
* data we have (html/other)                      *
\************************************************/
$head = processHeaders($page->getHeaders(), $file, $mime_dl, $type, $isDown, $isHtml, $isImage);
/************************************************\
* 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                                      *
\************************************************/