The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
PHP Include errors
hi i wrote the following and it works fine in an iframe or whatever but if i try to use include i get the following errors.
include '/home/***/public_html/community/cforumstats.php'; PHP Code:
PHP Code:
--------------- Added [DATE]1235927532[/DATE] at [TIME]1235927532[/TIME] --------------- darn it! why would this work when i load the page in the browser but not using include? :x works: www.example.com/cforumstats.php does not work: include '/path/to/cforumstats.php'; |
#2
|
||||
|
||||
You're changing the working directory and not changing it back to what it was... That messes up your includes big time because it doesn't automatically change back.
Do like this: PHP Code:
|
#3
|
|||
|
|||
thank you for your reply!
i think i'm one step closer now because i only get one error now... [01-Mar-2009 13:20:13] PHP Fatal error: Call to a member function query_first_slave() on a non-object in /home/***/public_html/community/includes/functions.php on line 1368 |
#4
|
|||
|
|||
It appears that you are referencing items before having any reference sheet. Try including the global.php file first.
|
#5
|
|||
|
|||
new code below still gives this:
PHP Fatal error: Call to a member function query_first_slave() on a non-object in /home/***/public_html/community/includes/functions.php on line 1368 PHP Code:
|
#6
|
|||
|
|||
I would recommend you go through your code and look for any imperfections. What the code is saying that it is looking to reference something but there is a no object to look at.
I am out of ideas, I have reviewed the code and see nothing wrong. Since I do not have the other files to review and test I cannot tell you why. Make sure all files are calling the correct directory. You may have some files calling the incorrect directories of their files. |
#7
|
|||
|
|||
the code works otherwise it wouldn't work when it's loaded directly in the browser (http://www.example.com/cforumstats.php).
it's weird. i've been banging my head against the wall for a min. i'm trying to think if maybe it's conflicting with some modules on the main site or something. ps- i'm in chicago too |
#8
|
|||
|
|||
Yes, like I said, since you are including it something is not being called correctly. I will see what I can find out for you.
// Edit // Try removing the "./" in the beginning of Global.php. Your global.php should be in the same directory as your main forum installation. You are moving a directory back to your root folder. |
#9
|
|||
|
|||
i thought ../ was moving back a directory and ./ was the same directory.
but i'll give that a try and get back to ya. |
#10
|
||||
|
||||
I don't understand how that little php script can produce that error when nothing is even done in there. What is in your template?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|