| Fopen and Freadfile using proxy or behind firewall |
|
|
|
| Wednesday, 16 March 2011 16:56 |
|
Below is PHP code for Fopen and Freadfile with proxy <?php function preadfile($_url, $_proxy_name = null, $_proxy_port = 4480){ if(is_null($_proxy_name) || LOCAL_TEST){
return readfile($_url); }else{
$proxy_cont = '';
while(!feof($proxy_fp)) {$proxy_cont .= fread($proxy_fp,4096);}
fclose($proxy_fp);
echo $proxy_cont; return count($proxy_cont); } } function pfopen($_url, $_proxy_name = null, $_proxy_port = 4480) {
if(is_null($_proxy_name) || LOCAL_TEST){
return fopen($_url); }else{
$proxy_fp = fsockopen($_proxy_name, $_proxy_port); if (!$proxy_fp) return false; $host= substr($_url, 7); $host = substr($bucket, 0, strpos($host, "/"));
} } |
Produk Safety
Kacamata Safety (72) Sepatu Safety (Safety Shoes) (216) Sarung Tangan (Hand Gloves) (14) Head & Face Protection (24) Hearing Protection (14) Safety Clothes & Vest (26) Masker & Hood (40) Full Body Harness & Safety Belt (16) Safety Sign (9) Miscellaneous (5) Metal Detector (6) Coveralll Nomex (3)Usefull Site
Contact Us
Another Menu
| Blog |
| Old Shop |
| Javascript |
| PHP |
| Linux |












