vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Cannot add header information? (https://vborg.vbsupport.ru/showthread.php?t=34884)

voogru 02-08-2002 12:30 PM

im having a problem trying to include global.php in my main page (non-vB)

heres what the top of header.php looks like for my main site:

PHP Code:

<?
/*
Includes
*/
chdir("/home/voogru/public_html/forums");
require('global.php');
chdir("/home/voogru/public_html/");
?>
<title>voogru.com You IT Resource</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK REL="StyleSheet" HREF="/style/style.css" TYPE="text/css">
<style>
.last10{  border: 1px #616889 solid; background-color: #ffffff; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; text-decoration: none}
.pluhnews{  border: 1px #000000 solid; background-color: #F1F5F8; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; text-decoration: none}


the two errors i get are:

Warning: Cannot add header information - headers already sent by (output started at /home/voogru/public_html/index.php:3) in /home/voogru/public_html/forums/admin/functions.php on line 1610

Warning: Cannot add header information - headers already sent by (output started at /home/voogru/public_html/index.php:3) in /home/voogru/public_html/forums/admin/functions.php on line 1610


i tried everything i can think of, im very new to php so i need help!

thanks :)

Admin 02-08-2002 05:49 PM

In the
PHP Code:

/*
Includes
*/ 

part, do you have anything that echo/print/outputs stuff to the browser?

voogru 02-08-2002 06:00 PM

not that i know of, no

i belive /* and */ are for commenting out text, right?

thats just so when i put more code i cant find different areas easier.

TECK 02-09-2002 03:16 PM

hmmm.. you probably want to have 2 diff headers. this is not the best way to do it (in my oppinion). try this:

01. open root/global.php.

02. find the code:
PHP Code:

$templatesused.='gobutton,timezone,[...]' 

and add at the end:
PHP Code:

,home_headinclude,home_header,home_footer 

03. find the code:
PHP Code:

$header='';
$footer='';

// parse PHP include ##################
eval(gettemplate('phpinclude',0,0));

// parse css, header & footer ##################
eval("\$headinclude = \"".gettemplate('headinclude')."\";");
eval(
"\$header .= \"".gettemplate('header')."\";");
eval(
"\$footer .= \"".gettemplate('footer')."\";"); 

replace it with:
PHP Code:

$header='';
$headerhome='';
$footer='';
$footerhome='';

// parse PHP include ##################
eval(gettemplate('phpinclude',0,0));

// parse css, header & footer ##################
eval("\$headinclude = \"".gettemplate('headinclude')."\";");
eval(
"\$headincludehome = \"".gettemplate('home_headinclude')."\";");
eval(
"\$header .= \"".gettemplate('header')."\";");
eval(
"\$headerhome .= \"".gettemplate('home_header')."\";");
eval(
"\$footer .= \"".gettemplate('footer')."\";");
eval(
"\$footerhome .= \"".gettemplate('home_footer')."\";"); 

03. create the 3 templates with the content you want.

that should solve your prob ;).

voogru 02-10-2002 12:01 PM

i did that but i still get "Warning: Cannot add header information - headers already sent by (output started at /home/voogru/public_html/index.php:3) in /home/voogru/public_html/forums/admin/functions.php on line 1612" my problem is i cant figure out how to get global.php to work on a non-vb page. if someone can tell me how to include it it would be great, right now im trying to use:
PHP Code:

<?
/*
Includes
*/
chdir("/home/voogru/public_html/forums");
require('global.php');
chdir("/home/voogru/public_html/");
?>

and i dont know if this is the right way. if someone could point me in the right direction to include global.php it would be great.

thanks

TECK 02-10-2002 01:25 PM

what i would me is this:

01. create a insertcode.php file with all the code i need to add in specific files and place it in root/forum.

02. call insertcode.php in each file i want to add the specific code. in this way you will never have any problems.

Martz 02-10-2002 01:32 PM

From my very limited experience, I have got these "Cannot add header information" when I have used cpheader() and another <head></head> tag in the same file. Requiring the global.php will (I am guessing) format your page with the standard headers, if your including a another file or complete .html file this might conflict?

Might be worth a try :frus:


All times are GMT. The time now is 07:05 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.00938 seconds
  • Memory Usage 1,740KB
  • 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
  • (7)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete