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

Reply
 
Thread Tools Display Modes
  #1  
Old 05-19-2005, 12:20 PM
Xia Xia is offline
 
Join Date: Mar 2005
Location: Belgium
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default $DB_site not recognised.

I'm trying to log in from another part of my website.

I do this:

chdir ( '../../public_html/forums' );
require_once 'global.php';

And get this error:

Fatal error: Call to a member function on a non-object in /home/wa/public_html/forums/includes/sessions.php on line 73

Which is on a $DB_site line call..

I checked in includes/init.php and the $DB_site object is created just fine. Why isn't it accessible from within sessions.php?

Thanks!
Reply With Quote
  #2  
Old 05-19-2005, 12:22 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Change to:
PHP Code:
chdir'../../public_html/forums' );
require_once(
'global.php'); 
Reply With Quote
  #3  
Old 05-19-2005, 12:24 PM
Xia Xia is offline
 
Join Date: Mar 2005
Location: Belgium
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

uhm, what's the difference?

Update: I can access it fine in Sessions.php but not in the function build_session..

In that function it is defined as global $DB_site; so I don't understand why it wouldn't work. I echoed out the contents of $DB_site just before the call to the function and in the function. Works fine before, but is empty when inside the function.

Any ideas what is causing this?

Thanks
Reply With Quote
  #4  
Old 05-19-2005, 04:43 PM
AN-net's Avatar
AN-net AN-net is offline
 
Join Date: Dec 2003
Location: AnimationTalk.com
Posts: 2,367
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Xia
uhm, what's the difference?

Update: I can access it fine in Sessions.php but not in the function build_session..

In that function it is defined as global $DB_site; so I don't understand why it wouldn't work. I echoed out the contents of $DB_site just before the call to the function and in the function. Works fine before, but is empty when inside the function.

Any ideas what is causing this?

Thanks
um the difference is that require_once requires parentheses. also if you can not echo a class or mysql query. it may not be recognized in your new function because you must use global $DB_site;
Reply With Quote
  #5  
Old 05-19-2005, 06:49 PM
Xia Xia is offline
 
Join Date: Mar 2005
Location: Belgium
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Require_once doesn't require parentheses..There is no difference in using them or not, it may not be best coding practices, but it works. However, thanks for pointing that out.

Now, this function isn't new, it's build_session from sessions.php and it already has global $DB_site as I pointed out in my previous post. Any other ideas? Thanks
Reply With Quote
  #6  
Old 05-23-2005, 10:04 AM
Xia Xia is offline
 
Join Date: Mar 2005
Location: Belgium
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can anyone help?

Thanks!
Reply With Quote
  #7  
Old 05-23-2005, 11:08 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well maybe you should try to show a bit more of your script. Very hard to give a solution (or even understand your problem) by just 2 lines.
Reply With Quote
  #8  
Old 05-23-2005, 06:40 PM
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Posts: 3,972
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

" chdir( '../../public_html/forums' ); "
^^ What the hell is this? Of course you would get errors if you try to exit the root directory like this.. Where is your script located? If it is in root, then use:
chdir( './forums' );
If, for example, it is in public_html/somefolder, use:
chdir( '../forums' );
But do not ever tell your script to go deeper than public_html...

I wonder how you don't get a fatal error...
Reply With Quote
  #9  
Old 05-23-2005, 08:06 PM
jugo jugo is offline
 
Join Date: Feb 2004
Location: Reading your emails.
Posts: 573
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to show a bit more of your code in order for a proper answer to be given. I have a feeling.....

show me some code and i'll see if I can help.
Reply With Quote
Reply


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 11:07 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.03891 seconds
  • Memory Usage 2,231KB
  • Queries Executed 11 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (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_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
  • 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