if($_SERVER['HTTP_REFERER']== "site.com")
{
header("location:".$ys."");
}
else
{

gibi birşey mi ?
tam anlayamadım isteğini