gpt4 book ai didi

php - 标题被忽略

转载 作者:行者123 更新时间:2023-12-02 08:38:38 25 4
gpt4 key购买 nike

<?
session_start();
$id = $_SESSION['id'];
$email = $_COOKIE['email'];
$password = $_COOKIE['password'];
header('Location: ../');
// I tell it to redirect...
$cookie_expires = time() + 60*60*24;
$cookie_path = '/';
$cookie_name = 'temporary';
$cookie_value = 'Your account was deleted.';
setcookie($cookie_name, $cookie_value, $cookie_expires, $cookie_path);
// ...but the cookie is set!
?>
<!-- Why? -->

最佳答案

设置 Location: header (或任何其他对 header() 的调用)后,脚本继续执行。如果您希望立即发生重定向,而不执行脚本的其余部分,请在调用 header() 后立即 return;die; .

关于php - 标题被忽略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1609836/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com