что сделал не так ?
<?php
set_time_limit(0);
ini_set('memory_limit', '256M');
error_reporting(E_ALL);
ini_set('display_errors', 1);
function post($host, $script, $ref, $ua, $cook, $cont){
$respons="";
$postsock = fsockopen($host, 80, $errno, $errstr, 10);
if (!$postsock) echo $errstr($errno);
else
{
$head = "POST $script HTTP/1.1\r\n";
$head .= "Host: ipbmaster.ru";
$head .= "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0";
$head .= "Accept: image/png,image/*;q=0.8,*/*;q=0.5";
$head .= "Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3";
$head .= "Accept-Encoding: gzip, deflate";
$head .= "Referer: http://ipbmaster.ru/index.php?app=core&module=global§ion=login&do=process&a mp;a mp;q uot;;
$head .= "Connection: keep-alive";
$head .= "Content-Type: application/x-www-form-urlencoded";
$head .= "Content-Length: " .strlen($cont)."\r\n";
$head .= "\r\n$cont\r\n";
fwrite($postsock, $head);
print_r($cont);
while(!feof($postsock)){
$respons .= fgets($postsock, 4048);
}
fclose($postsock);
}
return $respons;
}
function getcookie($str){
$authcooki = '';
preg_match_all('/Set-Cookie:\s([^;]+)/i', $str, $temp);
$temp[1] = array_unique($temp[1]);
foreach($temp[1] as $cook){
$authcooki .= $cook . '; ';
}
return $authcooki;
}
$uza = 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)';
$acc = 'test1:test';
$bot = explode(':', $acc);
$login = $bot['0'];
$parol = $bot['1'];
############## Авторизация ########################
$f = file_get_contents('http://ipbmaster.ru/index.php?app=core&module=global§ion=log in&do=process /');
echo $f;
preg_match_all("#<input type='hidden' name='auth_key' value='(.*)'#",$f,$auth_key);
echo "<pre>";
$authdata = post('ipbmaster.ru', "/?app=core&module=global§ion=login&do=process", "http://ipbmaster.ru/", $uza,"", "referer=http://ipbmaster.ru&auth_key={$auth_key['1']['0']}&ips_username={$login}&ips_password={$parol}"); // запрос на авторизацию
// получение куков
$authcooki = getcookie($authdata);
print_r("<br>".$authdata);
?>