I need "calculate" an URL and redirect to it. I have the following code:
<?php
//Basic HTML parsing with PHP
include("simple_html_dom.php");
$htmlCode = file_get_html('http://example.net/example.html');
foreach($htmlCode->find('div[class=frontPageImage]') as $element) {
foreach($element->find('img') as $imagee)
$imgurl = $imagee->src;
}
header("'Location:".$imgurl."'");
?>
First in $imgurl get the url and later redirect to that url... but it doesn't work..
any idea or suggestion? thanks
$imgurl = $htmlCode->find('div[class=frontPageImage] img')->last_child()->src;.