![]() |
Headers already sent by . . .Snag with integration with Amazon Shop -- SOLVED
Hi everybody,
I have a quick question. I'm working on an integration of Ghostscripter's Amazon Store with my vBulletin installation, and I've come across a problem. I've got the script fairly well integrated into my site, with the header and footer "sandwiching" the Amazon Store code. Here's the code I add to the beginning of the Amazon Store php files to make most of it work: PHP Code:
HTML Code:
http://myserver.com/amazon/cart.php?cmd=add&asin=0345391802 Quote:
PHP Code:
I know people doing integrations of external scripts have come across this problem and I was wondering if anyone had a clue. Thanks, Kenny |
Try using this:
https://vborg.vbsupport.ru/showthrea...threadid=66084 |
Quote:
|
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. |
Quote:
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. |
All times are GMT. The time now is 01:02 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|