关于PHP的 header() 函数
在使用 PHP 的 header() 函数进行页面跳转的时候,我发现以下代码无法执行:
header('Location : App/index.php');
对照文档重新检查,终于发现 Location 必须紧跟后面的冒号,不能有空格。至于冒号后面有没有空格就无所谓了。
应该写成这样子:
header('Location: App/index.php');
天地孤影任我行
在使用 PHP 的 header() 函数进行页面跳转的时候,我发现以下代码无法执行:
header('Location : App/index.php');
对照文档重新检查,终于发现 Location 必须紧跟后面的冒号,不能有空格。至于冒号后面有没有空格就无所谓了。
应该写成这样子:
header('Location: App/index.php');