Page 1 of 1

Functions not found when included in an 'include' file

Posted: Thu Aug 07, 2003 11:01 pm
by gregambrose
I have defined a function which works fine when a part of the same source file as the one calling it. When I move it to a separate file I get the message "Call to undefined function".

The program is finding the include file (if I rename it it complains).

The include function is as follows :-

Code: Select all

<php?	

function uopendb($host, $user, $password, $db)
&#123;

	mysql_connect($host, $user, $password);	
	
	mysql_select_db($db);
	

	hhhlll;  // this is an intensional error which doesnt get reported
&#125;

?>

Posted: Fri Aug 08, 2003 12:55 am
by gregambrose
OK. I haven't been writing PHP very long. I got the tag on line 1 wrong. How fundermental an error is that.

I hope I haven't wasted anyone's time.