Re: Function declaration and use

From: Date: Wed, 27 Sep 2000 06:54:46 +0000
Subject: Re: Function declaration and use
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-17741@lists.php.net to get a copy of this message
Put http://alecto.bittwiddlers.com/private/testprint.php3 in a browser and see if you can read it. If you can't, maybe Php also can't jason ----- Original Message ----- From: "Matthew Harrell" <mharrell@bittwiddlers.com> To: "PHP General List" <php-general@lists.php.net> Sent: Monday, September 25, 2000 6:45 AM Subject: [PHP] Function declaration and use > > 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 > >

« previous php.general (#17741) next »