Hey lil,
Code:
$refinfo = parse_url($_SERVER['HTTP_REFERER']);
$levels = explode('.', $refinfo['host']);
$toplevel = array_pop($levels);
if (count($levels)) $dom = array_pop($levels).'.'.$toplevel;
if ($dom hahahaha 'okdomain.com') {
Header('Location: http://www.okurl.com/page.html');
} else {
Header('Location: http://www.badurl.com/page.html');
}
exit;
You could also use regex to do all this, but this should work just as well. Do not want to think of a weird regex to filter out a domain right now <G>