Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-02-2005, 03:04 AM
kyouens's Avatar
kyouens kyouens is offline
 
Join Date: Apr 2005
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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:
<?php
error_reporting
(E_ALL & ~E_NOTICE);
define('NO_REGISTER_GLOBALS'1);
define('THIS_SCRIPT''bookstore'); //Change to match file name
chdir('/var/www/html/vbulletin/');  //Change to server path of yoru forums
$globaltemplates = array(
    
'footer',
    
'header',
    
'navbar',
);
if (
$_REQUEST['page'])
{
    
$globaltemplates array_merge($globaltemplates);
}
require_once(
'./global.php');
globalize($_REQUEST, array('page' => STR,));

eval(
'$nakedheader = "' fetch_template('nakedheader') . '";');
eval(
'$footer = "' fetch_template('footer') . '";');
eval(
'$navbar = "' fetch_template('navbar') . '";');

$headinclude str_replace(array('"clientscript''url(images/gradients'), array("\"$vboptions[bburl]/clientscript""url($vboptions[bburl]/images/gradients"), $headinclude);
$footer str_replace('"cron.php'"\"$vboptions[bburl]/cron.php"$footer);

if (
$shownewpm AND $vboptions['showpm'])
{
    eval(
'$pmscript = "' fetch_template('pm_popup_script') . '";');
    
$footer .= str_replace('"private.php'"\"$vboptions[bburl]/private.php"$pmscript);
}
//-------- End call to VBulletin header and footer -------//
chdir("/var/www/html/amazon/");
After I do this, I have no problem with echoing my header and footer to the Amazon Store pages. The problem is when I try to access the cart.php to add items, etc. The urls when an item is to be added look like this:

HTML Code:
http://myserver.com/amazon/cart.php?cmd=add&asin=0345391802
When I try to do this, I get the following error, and no I don't have whitespaces before or after my php tags:
Quote:
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/amazon/cart.php:35) in /cart.php on line 116
I know that this error is occurring because global.php sends header / cookie information and the cart.php file also sends header information. I guess something must be getting printed or echoed in between. Here's an example of the code from cart.php that's altering the header (would post more but this code is proprietary):
PHP Code:
case'clear':
    unset(
$_SESSION['cart']['items']);
    
header("Location: cart.php");
    break;
case 
'remove':
    unset(
$_SESSION['cart']['items'][$_GET['asin']]);
    
header("Location: cart.php");
    break; 
Does anyone know of 1) a way to put all the output of global.php into a variable or something like that, then echo it in the cart.php file? 2) some other brilliant thing I haven't thought of yet?

I know people doing integrations of external scripts have come across this problem and I was wondering if anyone had a clue.

Thanks,
Kenny
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:01 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03953 seconds
  • Memory Usage 2,398KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_html
  • (2)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete