I'm a beginner in php but i have this code in perl this could help.
sub download_file {
my $document=shift @_;
$remote = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>'proxy.pacific.net.ph', PeerPort=>"8080", Reuse=>1) or die "Can't connect to \"$server\"\n";
=== set buffering off ===
$remote->autoflush(1);
=== write HTTP request to server ===
print $remote "GET $document HTTP/1.0\nUserAgent: Mozilla/4.0 (compatible;MSIE 5.0; Windows 95)\n\n";
=== recieve everything the server sends, and print it to the screen ===
my $filestring="";
while (<$remote>) {
$filestring=$filestring.$_;
}
close $remote;
return $filestring;
}
this is a function that downlaods a dynamic page then store it on a string variable.