Re: Call to undefined function problem

From: Date: Wed, 12 Sep 2001 17:02:27 +0000
Subject: Re: Call to undefined function problem
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-67063@lists.php.net to get a copy of this message
Typo in my explanation. I had "defined" in my code. Nice catch though. However, I'm running into more define issues. When I get to a file through a redirect via header("Location: /newfile.php"), my defines are existing as tested by "defined" but the values are all corrupt. However, if I then refresh the page, the value is good. Anyone else seen this in php-4.0.6? Can someone explain to me what is fixed for defines in the 4.0.7 candidate? Andrey Hristov <ahristov@icygen.com> wrote in message news:01ce01c13a93$a4fd6d00$0b01a8c0@ANDreY... > if (!define("__FUNCTIONS__") ) > must be: > > if (!defined("__FUNCTIONS__") ) > > > > Andrey Hristov > IcyGEN Corporation > http://www.icygen.com > BALANCED SOLUTIONS > > > ----- Original Message ----- > From: "Doug Farmer" <daf@peakpeak.com> > To: <php-general@lists.php.net> > Sent: Tuesday, September 11, 2001 6:50 AM > Subject: [PHP] Call to undefined function problem > > > > > > I'm doing the following: > > > > ---- test.php ----- > > <?php > > require("functions.php"); > > require("...."); // several other requires here > > > > setNoCacheHeaders(); // this is line 16 > > > > // other stuff here > > ?> > > > > ------ functions.php ----- > > <?php > > > > if (!define("__FUNCTIONS__") ) > > { > > define( "__FUNCTIONS__", 1, 1 ); > > > > // a bunch of other defines here > > echo "here 1<br>"; > > function setNoCacheHeaders( ) { > > static $headersNotSet = TRUE; > > > > if ( $headersNotSet ) { > > header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the > > past > > header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " > > GMT"); // > > always modified > > header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 > > header("Pragma: no-cache"); // HTTP/1.0 > > $headersNotSet = FALSE; > > } > > } > > echo "here 2<br>"; > > > > // a few more functions here > > > > } > > > > -------------------------------- > > > > My output is > > here 1 > > here 2 > > > > Fatal error: Call to undefined function: setnocacheheaders() in > > $DOCUMENT_ROOT/test.php on line 16 > > > > Can someone explain? I found something similar in the archives but no > > answer was given. This exact code worked under php3. The only changes in > > the files were files ending in php3 were changed to end php. I also had 2 > > classes that I was using that had initializers in the variable declaration. > > I moved the initialization to constructors. > > > > Note that on some clients the request goes through w/o errors. This is > > intermittent but consistent on a per client basis. > > > > - doug > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > > > >

« previous php.general (#67063) next »