不管你是PHP新手还是PHP大拿,看看下面代码如何运行:

if(TRUE)
{
  header("Location: www.51cto.com");
}
header("Location: www.sina.com.cn");

你肯定会说,我们进入了51CTO的站点。

NO!实际情况却是你进入了新浪!


要进入51CTO,你得这样:

if(TRUE)
{
  header("Location: 
  exit(); 
}
header("Location: www.sina.com.cn");


呵呵!