<?php
$url="http://www.norskbildelkatalog.no/default.aspx?cat=2&Id=18";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url); // set url to post to
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable
curl_setopt($ch, CURLOPT_TIMEOUT, 20); // times out after 4s
curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8');
curl_setopt($ch, CURLOPT_COOKIEJAR, './cook.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, './cook.txt');
$html = curl_exec($ch);
$ch = curl_init('http://www.norskbildelkatalog.no/default.aspx?cat=2&Id=18');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '__VIEWSTATE=%2FwEPDwULLTE2OTYxMTQyOTJkZKnDWEWkr2o2KzEZL%2FUtwkVYytbh&__EVENTVALIDATION=%2FwEWBAKCiZ7KBAL06sf%2FAQK%2F0oqcCQLnrI%2BZD94ytl4m3yVK2AjSmUM%2FlJpk24m3&ctl00%24tbUserName=vwx7a&ctl00%24tbPassword=smwhe&ctl00%24btnLogin=');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5');
curl_setopt($ch, CURLOPT_COOKIEJAR, './cook.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, './cook.txt');
$res = curl_exec($ch);
echo $res;
?>