1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
<?php
$request = $_SERVER['QUERY_STRING'];
if (preg_match('@^url=(.*)$@',$request,$matches)) {
$url = $matches[1];
} else {
die();
}
set_include_path('..' . PATH_SEPARATOR . get_include_path());
require('../Zend/Http/Client.php');
$client = new Zend_Http_Client(
"https://www.domaine.com/$url",
array(
'timeout' => 30,
'adapter' => 'Zend_Http_Client_Adapter_Socket',
'ssltransport' => 'tls'
)
);
$client->setAuth('login', 'password');
$response = $client->request();
if (!$response->isSuccessful()) die();
echo $response->getBody(); |