Re: Function declaration and use

From: Date: Mon, 25 Sep 2000 14:09:42 +0000
Subject: Re: Function declaration and use
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-17396@lists.php.net to get a copy of this message
As a guess I think it's because you're using the url file handler to open the file and not the direct path. Try switching the include reference to be the fully qualified path to the file instead of the httpd url to the file. Reason being I'm guessing is that for some reason you don't have proper access to pull that url at the httpd level where as if you told php3 to go fetch it directly off the disk you'ld be able to grab it. While you're at it, check the permissions of the file are readable by user your php script runs as. -- Scott On Sun, Sep 24, 2000 at 04:45:27PM -0400, Matthew Harrell wrote: > > Hi, > I'm new to PHP so maybe this is much easier than I'm making it. Also, > I'm currently using PHP 3.0.16. > > I've currently got an HTML page that looks like > > <html> > > <?php > include ( > "http://alecto.bittwiddlers.com/private/testprint.php3" ); > > testprint ( "this is a test string" ); > ?> > > </html> > > with the function testprint.php3 containing > > <?php > function testprint ( $string ) { > echo "This is a test<BR>\n"; > echo $string . "<BR>\n"; > } > ?> > > but when I try to load the page I get the error > > Fatal error: Call to unsupported or undefined function testprint() in > /usr/local/apache/htdocs/files/test1.php3 on line 7 > > If I directly put the function in the page (without the include) then it works > fine. What am I doing wrong? > > Thanks > > -- > Matthew Harrell Beauty is in the eye of the beer > Bit Twiddlers, Inc. holder. > mharrell@bittwiddlers.com > > -- > 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 -- Scott

« previous php.general (#17396) next »