vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Accessing user/cookie info outside of vBulletin (https://vborg.vbsupport.ru/showthread.php?t=170110)

Greg-J 02-14-2008 11:00 AM

It recognizes logged in users fine. It's when you view the page when you're not logged in. The script doesn't even get all the way through global.php before it starts spitting out information...

cheesegrits 02-14-2008 03:12 PM

That link you posted works fine for me. Shows the link back to the page, and "not logged in".

-- hugh

Greg-J 02-18-2008 07:10 AM

Quote:

Originally Posted by cheesegrits (Post 1442966)
That link you posted works fine for me. Shows the link back to the page, and "not logged in".

-- hugh

Really?

This is what I get when navigating to that page while not logged in:

Code:

Notice: Undefined index: HTTP_REFERER in /var/www/vhosts/myspacepros.com/httpdocs/forum/includes/class_core.php on line 1574

Unable to add cookies, header already sent.
File: /var/www/vhosts/myspacepros.com/httpdocs/forum/includes/class_core.php
Line: 1574

I'm a bit lost now....

cheesegrits 02-18-2008 02:18 PM

That's because you have error reporting set to include notices in PHP. Which generates a 'notice' output if $_SERVER['HTTP_REFERER'] isn't set when vB tries to do this:

PHP Code:

        define('REFERRER',       $_SERVER['HTTP_REFERER']); 

When I hit the page, I'm clicking the link on this page first, so the HTTP_REFERER is set with the vborg page I'm being referred by. If you hit your page without being 'referred' by another page (i.e. type the URL in by hand in your browser), then HTTP_REFERER won't be set. And because the notice is being printed before vB sends the page headers, it screws up page output.

To fix that you'll need to turn off 'notice' level reporting in php.ini:

Code:

;  - Show all errors except for notices and coding standards warnings
;
error_reporting  =  E_ALL & ~E_NOTICE

Of course the real fix would be for vB to test for the existence of $_SERVER['HTTP_REFERER'] before using it in a define(), so if you want to go submit a bug report on vb.com ...

-- hugh

Greg-J 02-20-2008 12:10 AM

Thank you very much cheesegrits. I'm a little embarrassed I didn't think of that myself to be honest. Thank you.


All times are GMT. The time now is 12:50 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
  • Page Generation 0.01054 seconds
  • Memory Usage 1,728KB
  • 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
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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