I had trouble with this error, then I saw someone recommend using another
way to perform the redirection, for example, like this....
$url=$HTTP_REFERER;
print("<meta http-equiv=\"refresh\" content=\"3;URL=$url\">");
Your url would be
"http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/images/$file
_name" of course.
If you replace the 3 with a 0 the redirection occurs straight away.
I don't understand enough to know whether using this method can be dangerous
or not recommended for some reason. Maybe not all browsers support it ???
This is what I use anyway. It avoids the "headers already sent" error
you're seeing.
Anyone got any comments on it ??
Ged
<so***@mic.gov.eg> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
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