Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP header()的用法及其原因';t重定向_Php - Fatal编程技术网

PHP header()的用法及其原因';t重定向

PHP header()的用法及其原因';t重定向,php,Php,我试图做一个简单的注销页面,它会破坏用户会话,然后将他们重定向到主页。。。。不知道为什么这不起作用。这是全部文件 <?php session_destroy(); header('location: http://example.com'); ?> 使用ob_start()在页面顶部。。 和ob_clean()。。那么这项工作很好。使用ob_start()在页面顶部。。 和ob_clean()。。那么这项工作很好。使用ob_start()在页面顶部。。 和ob_clean()。。

我试图做一个简单的注销页面,它会破坏用户会话,然后将他们重定向到主页。。。。不知道为什么这不起作用。这是全部文件

<?php
session_destroy();
header('location: http://example.com');
?>

使用ob_start()在页面顶部。。 和ob_clean()。。那么这项工作很好。

使用ob_start()在页面顶部。。 和ob_clean()。。那么这项工作很好。

使用ob_start()在页面顶部。。 和ob_clean()。。那么这项工作很好。

使用ob_start()在页面顶部。。 和ob_clean()。。那么这项工作就可以了。

试试下面的代码

session_destroy();
header("Location: http://example.com/myOtherPage.php");
试试下面的代码

session_destroy();
header("Location: http://example.com/myOtherPage.php");
试试下面的代码

session_destroy();
header("Location: http://example.com/myOtherPage.php");
试试下面的代码

session_destroy();
header("Location: http://example.com/myOtherPage.php");

可能您有
?>可能您有
?>可能您有
?>可能您有
?>希望它对您有用:

<?php
session_destroy();
header("Location: http://www.example.com/");
exit;
?>

希望它对您有用:

<?php
session_destroy();
header("Location: http://www.example.com/");
exit;
?>

希望它对您有用:

<?php
session_destroy();
header("Location: http://www.example.com/");
exit;
?>

希望它对您有用:

<?php
session_destroy();
header("Location: http://www.example.com/");
exit;
?>