php:我的标题功能没有用。

时间:2016-03-04 08:48:22

标签: php netbeans printing header

我的标题功能无效。 我创建了2页test和test2

测试中的所有代码:

<?php 
//header('Location ../index.php');
  header("Location ./test2.php"); ?>

页面test2中的所有代码

<?php   echo 'hello';    ?>

为什么我的功能不起作用?在它面前没有回声,这是最大的问题。这是这两页中的所有代码。

感谢

1 个答案:

答案 0 :(得分:5)

你的语法错误,应该是(注意:):

<?php 
  header("Location: ./test2.php"); 
?>

提供文件是应该工作的。确保路径正确,目前你指向同一目录

相关问题