// Set basic vars
$iframePath = 'http://www.practiceresources.co.uk';
// Get path
if(isset($_GET['tc'])){
$tc = trim($_GET['tc']);
$path = $iframePath.$tc;
}
else {
$path = $iframePath.'/resources/tax_centre/?s=incisive';
}
$page = file_get_contents($path);
//echo '
'.$path.'
'."\n";
// Split page into sections, chopping off the top rubbish
$split1 = explode('
// $split1[1] is now the main content, but we need to shop off the bottom rubbish
$split2 = explode('
',$split1[1]);
// $split2[0] is now our content
$newContent = $split2[0];
// add
','
',$newContent); // closing H tag
$newContent = str_replace('href="/resources/tax_centre','href="/articles/tax-centre',$newContent);
$newContent = str_replace('/budgets.php?','?',$newContent);
$newContent = str_replace('.php"','"',$newContent);
$newContent = str_replace('rel="external"','rel="external" target="_blank"',$newContent);
echo $newContent;
?>