$_SERVER[HTTP_REFERER]哦,学习,以前只用过asp的。
<script>
if (window.opener==null)
{
   self.href="http://www.sohu.com";
}
</script>