这个问题有时可能是由于禁用或拒绝接受cookies造成的

问题描述 投票:0回答:1

我在编写 php 重定向时在 drupal6 中遇到以下问题。

问题是:

页面没有正确重定向 Firefox 检测到服务器正在以一种永远不会完成的方式重定向对该地址的请求。

这个问题有时可能是由于禁用或拒绝接受cookies造成的。

我写过这样的代码:

global $base_url,$user;
$uid = $user->uid;

$msg = "Please select your user type (capital provider or project sponsor) and agree to the terms and conditions. Then, you’ll be able to post and find capital or a project in which to invest.";

$url =  $base_url."/editProfile?message=".$msg;

header("Location: $url");
php drupal drupal-6
1个回答
1
投票

您需要测试当前页面是否与您要重定向到的页面相同。

if (getCurrentPage() == "editProfile" && getCurrentMessage() == $msg) // THEN DO NOT REDIRECT
© www.soinside.com 2019 - 2024. All rights reserved.