vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Issue with vBulletin php include on non vb page (https://vborg.vbsupport.ru/showthread.php?t=192803)

Dismounted 10-10-2008 04:09 AM

"Unable to add cookies" means you have sent output to the browser before the script could send cookie headers. Whitespace is considered output.

Marco van Herwaarden 10-10-2008 07:56 AM

Please also post the contents of index-test.php.

DandD 10-10-2008 10:44 PM

Hey guys,

Thanks to all of you for your continued support. I've stripped down the code to the bare minimum. Currently this is the entire code for the index-test.php page:

=========
<?php chdir('/home/xxxx/public_html/forum'); ?>
<link href="http://www.lahabraevents.com/forum/clientscript/vbulletin_css/style-b391d83b-00002.css" rel="stylesheet" type="text/css">
<?php include ("http://www.lahabraevents.com/forum/calendar.php"); ?>
=========

As previously suggested I added to the headinclude template:

=========
base href="http://www.lahabraevents.com/forum/"
=========

I've tried various combinations of code, changing the order, making sure to delete white space, etc. but still can't get this to work. (I have also tried putting the two php code elements within the same php tags with no difference. The reason they are separate is I need to use some table tags for layout.) As the code is above, the calendar loads on the page and there are no error codes but the login status and calendar view links are not correct. If I make the include path relative ("calendar.php"), we get the error:

"Unable to add cookies, header already sent.
File: /home/xxxx/public_html/index-test.php
Line: 3"

I understand the idea there may be conflict due to duplicate header calls. I just don't know how to avoid it. As Dismounted previously suggested, I've tried using the calendar.php code on the index page rather than using an include but I don't know how to delete the header call - IF that is what I need to do.

Once again, I appreciate any other ideas or suggestons.
David

Dismounted 10-11-2008 03:12 AM

In your code:
Code:

<?php chdir('/home/xxxx/public_html/forum'); ?>
<link href="http://www.lahabraevents.com/forum/clientscript/vbulletin_css/style-b391d83b-00002.css" rel="stylesheet" type="text/css">
<?php include ("http://www.lahabraevents.com/forum/calendar.php"); ?>

Your second line is output. global.php (which is included in calendar.php), will most likely set cookies. That can't happen because you've already sent output to the browser.

DandD 10-11-2008 05:10 AM

Quote:

Originally Posted by Dismounted (Post 1642443)
In your code:
Code:

<?php chdir('/home/xxxx/public_html/forum'); ?>
<link href="http://www.lahabraevents.com/forum/clientscript/vbulletin_css/style-b391d83b-00002.css" rel="stylesheet" type="text/css">
<?php include ("http://www.lahabraevents.com/forum/calendar.php"); ?>

Your second line is output. global.php (which is included in calendar.php), will most likely set cookies. That can't happen because you've already sent output to the browser.

By the second line, I assume you mean the link href code. After more testing I can get things to work but it appears I cannot have ANY html between the two above lines of php, not even some table tags where I wanted to place the include file. And any html on the page after the php is ignored - my added footer does not display. Not the end of the world - at least we have fixed the main issue.

Thanks again everyone for all the help. I really do appreciate it.

David

Dismounted 10-11-2008 09:41 AM

Quote:

Originally Posted by DandD (Post 1642482)
By the second line, I assume you mean the link href code. After more testing I can get things to work but it appears I cannot have ANY html between the two above lines of php, not even some table tags where I wanted to place the include file.

That is correct. Any character sent to the browser is considered output. HTML is sent directly to the browser.


All times are GMT. The time now is 01:46 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.04290 seconds
  • Memory Usage 1,727KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete