PHP Code To Access A Webpage Using Proxy


Are you looking for a php code to access a website using a proxy server with PHP.Here i am going to explain the simplest php code to read a webpages using proxy with PHP function  file_get_contents()
Code :
<?php
$aContext = array(
'http' => array(
'proxy' => 'tcp://84.201.212.38:3128', // proxy here
'request_fulluri' => true,
),
);
$cxContext = stream_context_create($aContext);
$sFile = file_get_contents("http://www.yahoo.com/", False, $cxContext); // webapge here
echo $sFile;
?>

2 comments:

  1. Its about file sharing block but I want to inform all of you that you can access any blocked site at your home or anywhere
    bTVguide UK proxy

    ReplyDelete
  2. I salute to the admin of this blog. I really like and I will surely recommend this blog to my friends. For your concerns solution visit this link
    bTVguide UK proxy

    ReplyDelete

Post Your valuable comments here ..........