【发布时间】:2011-08-30 08:08:41
【问题描述】:
我使用上面的 PHP 代码在 www 文件夹中使用 Wamp 创建了一个本地页面,我想重定向到该页面,但是带有标头的重定向不起作用。
我收到消息:
页面未正确重定向。
Firefox 检测到服务器正在以永远不会完成的方式重定向对该地址的请求。此问题有时可能是由禁用或拒绝接受 cookie 引起的
有人知道怎么做吗?
我的代码:
$myFileName_with_no_lower_case = 'website_name'.$job.$ville;
$myFileName = strtolower($myFileName_with_no_lower_case);
$myFileHandle = fopen($myFileName, 'w') or die("can't open file");
$file_content = file_get_contents('./file_with_content_i_want_to_paste.php');
fwrite($myFileHandle,$file_content);
fclose($myFileHandle);
// eveything works fine until now
header("Location:".$myFileName);
【问题讨论】:
-
@Pekka 你是对的,谢谢!但是现在我遇到了另一个问题(相关,所以我不会更改帖子)。
标签: php file redirect wamp webpage