Re: Include help
| From: | Toby Butzon | Date: | Sun, 03 Dec 2000 09:27:54 +0000 |
| Subject: | Re: Include help | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-28422@lists.php.net to get a copy of this message | ||
Where is $DB_dotBanner instantiated? It seems to me that the object is
declared in the file that's working, but when you go to include the include
file in a *different* file, $DB_dotBanner hasn't been declared, thus you get
an error saying it's a "non-object" - ie, you haven't created an object of
the class, and it has no idea what object $DB_dotBanner is supposed to be.
Find where you're creating $DB_dotBanner and see if you can put it, too, in
the include file so any file you include the include file in will have
access to it.
Let me know how things go -
Toby Butzon
[ criticism spurs improvement ]
----- Original Message -----
From: "Leon Mergen" <leon@blazenetwork.com>
To: "Toby Butzon" <php-lists@imawebdesigner.com>
Sent: Sunday, December 03, 2000 4:26 AM
Subject: Re: [PHP] Include help
: On line 44, there is:
:
: $ShowAllQuery=$DB_dotBanner->dotBanner_query("select * from advertisers
: where Display_Zone like \"%$Zone%\" OR Display_Zone = \"*\" AND
: Awaiting_Approval=\"F\" AND (($Seconds_Now>Start_Second AND
: $Seconds_Now<End_Second) OR ($Seconds_Now>Start_Second AND
: Start_Second>End_Second) OR ($Seconds_Now<End_Second AND
: Start_Second>End_Second)) AND (Ad_Type=\"N\" OR (Ad_Type=\"C\" AND
: Max_Adverts<Visits) OR (Ad_Type=\"D\" AND now()>Advertiser_Start AND
: now()<Max_Adverts) OR (Ad_Type=\"E\" AND Max_Adverts>Shown))");
:
:
: And, this offcourse is in the function "dotBanner_PickBanner" ... I found
: out that when I include ad.php NOT in a function of my PHP scripts, it
: works, but as soon as I include that file inside a function of one of my
: scripts, it gives the error
:
: ---
: I love work! I can watch it for hours!
: ----- Original Message -----
: From: "Toby Butzon" <php-lists@imawebdesigner.com>
: To: "Leon Mergen" <leon@blazenetwork.com>
: Cc: <php-general@lists.php.net>
: Sent: Sunday, December 03, 2000 10:17 AM
: Subject: Re: [PHP] Include help
:
:
: > Actually, better still, what's on line 44 of
: > /home/blazenet/ads/ads-noprint.php ?
: >
: > Toby Butzon
: > [ criticism spurs improvement ]
: >
: >
: > ----- Original Message -----
: > From: "Leon Mergen" <leon@blazenetwork.com>
: > To: "Toby Butzon" <php-lists@imawebdesigner.com>
: > Cc: <php-general@lists.php.net>
: > Sent: Sunday, December 03, 2000 4:17 AM
: > Subject: Re: [PHP] Include help
: >
: >
: > : The standalone code of a file I want to include is this (and works
: > : perfectly) :
: > :
: > : <?
: > : $dotBanner_file_directory = "/home/blazenet/ads/";
: > : include("$dotBanner_file_directory" . "ads-noprint.php");
: > : print dotBanner_PickBanner("antrophia");
: > : ?>
: > :
: > :
: > : but as soon as I want to include this code in another php file, it
: > generates
: > : the error...
: > : ---
: > : I love work! I can watch it for hours!
: > : ----- Original Message -----
: > : From: "Toby Butzon" <php-lists@imawebdesigner.com>
: > : To: "Leon Mergen" <leon@blazenetwork.com>;
<php-general@lists.php.net>
: > : Sent: Sunday, December 03, 2000 10:04 AM
: > : Subject: Re: [PHP] Include help
: > :
: > :
: > : > Can you please post the code that's generating this error?
: > : >
: > : > Toby Butzon
: > : > [ criticism spurs improvement ]
: > : >
: > : >
: > : > ----- Original Message -----
: > : > From: "Leon Mergen" <leon@blazenetwork.com>
: > : > To: <php-general@lists.php.net>
: > : > Sent: Sunday, December 03, 2000 4:07 AM
: > : > Subject: [PHP] Include help
: > : >
: > : >
: > : > : Hello,
: > : > :
: > : > : I'm trying to use a require() or include() (doesn't matter to me)
in
: a
: > : PHP
: > : > script, but I get this error:
: > : > :
: > : > : Fatal error: Call to a member function on a non-object in
: > : > /home/blazenet/ads/ads-noprint.php on line 44
: > : > :
: > : > : What does this mean, and how can I fix it?
: > : > :
: > : > : Thanks
: > : > :
: > : > : ---
: > : > : I love work! I can watch it for hours!
: > : > :
: > : >
: > :
: > :
: >
:
: