Quote:
Originally Posted by Guy G
That sometimes happens if you have a space between the ending for the page and the ending of the script.
delete all that is between the ?> and the end.
|
There's not any space there in my file. I checked after I came across that as a solution in my first round of forum searching for an answer

Thanks.
I was able to resolve this issue, and I think the solution I found could be useful for integration of other complex scripts that send their own cookies, change headers, etc.
What I did was this: Made a seperate php file called headerinclude.php like this:
ob_start();
--include global php
--output the header only
(This is shown in several other forum posts.)
$header=ob_get_contents();
ob_clean();
Then I included headerinclude.php and encompassed the rest of the contents of my external file (except the php tags, obviously) (in my case cart.php) in another set of output buffer.
-include headerinclude.php
ob_start();
--EXTERNAL PHP file goes here
(This is shown in several other forum posts.)
$content=ob_get_contents();
ob_clean();
Then I echo this:
echo $header;
echo $content;
and it works, with all cookies, etc. apparently intact, and without that header already sent error.