Skip to content

Instantly share code, notes, and snippets.

@ivanscm
Created September 5, 2011 16:33
Show Gist options
  • Select an option

  • Save ivanscm/1195408 to your computer and use it in GitHub Desktop.

Select an option

Save ivanscm/1195408 to your computer and use it in GitHub Desktop.
<?php
if (isset($_SERVER['HTTP_REFERER']))
{
$referer = $_SERVER['HTTP_REFERER'];
$key_list = @file('textbase.txt');
foreach($key_list as $key_line)
{
$line = explode(';', $key_line);
foreach(explode(',', $line[0]) as $keyword)
{
if ((bool)stristr(strtolower($referer), $keyword))
{
header('Location: '.$line[1]);
break;
exit();
}
}
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment