重定向到另一个页面 [英] to redirect to another page
问题描述
我想重定向到另一个文件,这不是正确的代码吗
header(" Location:http://"。$ _ SERVER [ ''HTTP_HOST'']。dirname($ _ SERVER [''PHP_SELF''])。" / images / $ file_name");
解释器给我这个erorr而不是重定向
警告:无法修改标题信息 - 已经由
发送的标题(输出从E:\tryphp \direct.php:9开始) E:\tryphp \direct.php
第70行
代码中有什么问题因为我不明白这个错误
I want to redirect to another file, isn''t this the right code to do so
header("Location:http://".$_SERVER[''HTTP_HOST''].dirname($_SERVER[''PHP_SELF''])."/images/$file_name");
the interpreter give me this erorr instead of redirecting
Warning: Cannot modify header information - headers already sent by
(output started at E:\tryphp\direct.php:9) in E:\tryphp\direct.php on
line 70
what''s wrong in the code coz i don''t understand the erorr
推荐答案
_SERVER [''HTTP_HOST'']。dirname(
_SERVER[''HTTP_HOST''].dirname(
_SERVER [' 'PHP_SELF''])。" / images /
_SERVER[''PHP_SELF''])."/images/
file_name");
解释器给我这个erorr而不是重定向
警告:无法修改标题信息 - 已经由
发送的标题
(输出从E:\tryphp \direct.php:9开始)在E:\tryphp \direct.php上
第70行
>
代码中有什么问题因为我不理解这个错误
file_name");
the interpreter give me this erorr instead of redirecting
Warning: Cannot modify header information - headers already sent by
(output started at E:\tryphp\direct.php:9) in E:\tryphp\direct.php on
line 70
what''s wrong in the code coz i don''t understand the erorr
这篇关于重定向到另一个页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!