Function declaration and use

From: Date: Sun, 24 Sep 2000 20:45:27 +0000
Subject: Function declaration and use
Groups: php.general 
Request: Send a blank email to php-general+get-17336@lists.php.net to get a copy of this message
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

« previous php.general (#17336) next »