Thanks,
Jason
jason...@gmail.com писал(а):
- Jason
Check your code for echo or print commands before the header().
-david-
And if you include any files before sending header, check that in the
end of these files there were no new lines or spaces after '?>'
Are there other better ways of doing it?
- Jason
> So all I really want to do is just to be able to refresh the current
> page. Other than:
> <META HTTP-EQUIV='Refresh' CONTENT='0;URL="blah.php'>
> and
> header("Location: " . $_SERVER['HTTP_REFERER']);
>
> Are there other better ways of doing it?
>
> - Jason
Just one:
<script type="text/javascript">
window.location = document.referrer
</script>
-david-
r u setting any cookie before the
> header("Location: " . $_SERVER['HTTP_REFERER']);
if so, that's the reason u r getting this error. check it out.
babal
- Jason
Jason - you can do it like you are trying to. Like the other replies
before had said, just make sure you have NO output before that
header(); line. This includes any space(mentioned), and any html
(mentioned).
Good luck :)
Although not a complete technical explanation, php basically starts
trying to stream created content to the client (through the httpd
server) and since the header officially stops with the first content
element, be it a space, an <html> or <DOCTYPE> tag, etc. If you buffer
the output, it will continue to be modifiable until the buffer is
released (or the end of page exicution, iirc)
resource: http://us3.php.net/outcontrol
example: (from previous url)
<?php
ob_start();
echo "Hello\n";
setcookie("cookiename", "cookiedata");
ob_end_flush();
?>