I try to retrieve info from a webpage using simple_html_dom, like this:
<?PHP
include_once('dom/simple_html_dom.php');
$urlpart="http://w2.brreg.no/motorvogn/";
$url = "http://w2.brreg.no/motorvogn/heftelser_motorvogn.jsp?regnr=BR15597";
$html = file_get_html($url);
foreach($html->find('a') as $element)
if(preg_match('*dagb*',$element)) {
$result=$urlpart.$element->href;
$resultcontent=file_get_contents($result);
echo $resultcontent;
}
?>
The $result variable first gives me this URL: http://w2.brreg.no/motorvogn/dagbokutskrift.jsp?dgbnr=2011365320&embnr=0®nr=BR15597
When accessing the above URL with my browser, i get the content i expect.
When retrieving the content with $resultcontent, i get a different result, where it says in norwegian "Invalid input".
Any ideas why?