vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Including global.php in non-VB page (https://vborg.vbsupport.ru/showthread.php?t=97423)

hamedatl 10-03-2005 03:04 AM

Including global.php in non-VB page
 
I've been searching on the boards here for a while.. and have been doing some testing on my own. I'm just trying to do a simple check to see if the user is already logged in:

I have the following code:


PHP Code:

<?php
    error_reporting
(E_ALL);
    
chdir("forum/");
    include(
'./global.php');    
    include(
'./includes/functions_user.php');
//    echo "curr dir = " . getcwd();
//    echo " user = $vbulletin->userinfo['username']";
?>

But no matter what, I keep getting the following error:

Unable to add cookies, header already sent.
File:
Line: 0

From searching, it seems that error message should include the file, line, but it doesn't. I'm able to replace the includes with a PHP header('url') and it redirects fine... which is very weird.. I'm using IIS in case this matters.

Any clues? Thanks.

Blah, I removed error_reporting(E_ALL); and upgraded to 3.5 final from RC3 and now it all works.. weird


All times are GMT. The time now is 02:29 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.01005 seconds
  • Memory Usage 1,708KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)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