Click to See Complete Forum and Search --> : Headers.. whose on first?


asolell
05-24-2003, 05:31 PM
In my update file I have the following code (it is a PHP file):


function do_redirect ( $url )
{
Header ( "Location: $url" );
exit;
}



echo"
<script>
parent.treeframe.window.location.reload()
</script>";

do_redirect ("ListInventoryItem.php");

I get error of "Already Sent Headers" - from the reload statement.

How can I do a reload and then do a redirect?

Thanks,

-Alon.

Nevermore
05-25-2003, 04:05 AM
You can't send new headers once any information has been sent to the browser. This means that their can have been no HTML before the header code, only PHP. Also, the PHP must not use any echo or print statements.

asolell
05-25-2003, 05:10 AM
Thanks, that became clear now.

-Alon.