重定向到在 www Wamp 文件夹中动态创建的本地网页
我使用上面的 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);
I use the PHP code above to create a local page using Wamp in the www folder and I'd like to redirect to this page but the redirection with header doesn't work.
I get the message :
The page isn't redirecting properly.
Firefox has detected that the server is redirecting the request for this address in a way that will never complete. This problem can sometimes be caused by disabling or refusing to accept cookies
Does someone know how to do this ?
my code :
$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);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是您的解决方案,是我工具箱中我最喜欢的功能之一:)
this is your solution, one of my faverite functions in my toolbox :)
现在工作:
Works now :