Hi

My name is Gal.
i suggests a solution to the problem for people like me that found behind
firewall and can't see the pages under port 8080.
my suggestion is to use PHP that will bring the content of the pages that
found under port 8080 from a PHP script that runs under the port 80 web
server.

this is a content of PHP file that is name let's say "BringPage.php":
<?
function FgetStr($path,$startTAG,$endTAG) {
        if (strstr($path,"/etc/") || strstr($path,"passwd")){
        // if you want to limit or make some validations this is the place
                die;
        } 
        $pagefile = fopen($path, "r"); 
        $data = fread($pagefile, 99999); 
        if (eregi($startTAG."(.*)".$endTAG, $data, $out)) { 
                $outdata = $out[1]; 
        } 
        return $outdata; 
}
?>

a simple example how to use it:
<?
include("BringPage.php");
$HTML = FgetStr("http://www.php.net",";<html>","</html>");
$HTML = "<html>\n".$HTML."\n</html>\n";

 // i just entered this to make a base href that the images will be taken
from php.net
$HTML = str_replace("<head>","<head>\n<base
href=\"http://www.php.net/\";>",$HTML);
echo $HTML;
?>
----------------------------------------------------------------------------
----------------

about bringing images:
a content of a file called TakeImage.php
<?
set_time_limit(600);

function openFile ($the_file)
{
    $fcontent = "";
    if (!($fp = fopen($the_file, "r"))){
        die("could not open $the_file input");
        return -1;
    }

    // read the file into a string
    while ($Buf = fread($fp, 4096)){
       $fcontent = $fcontent.$Buf;
    }
    fclose ($fp);
    return $fcontent;
}

$cntnr = openFile ($BringME, "r");
echo $cntnr;
?>


to use it:
<img src="TakeImage.php?BringME=http://www.php.net/gifs/php_logo.gif";
border="0" alt="">

this is just a few thing that i was thinking about and i've tried them.

what do u think ?

Gal

----------------------------------------------------------------------------
To unsubscribe, send a message to [EMAIL PROTECTED]
Archives available at http://www.mail-archive.com/[email protected]/

Reply via email to