Page 1 of 1

Question regarding undefined function

Posted: Tue Sep 16, 2008 12:51 am
by linkexchangers
Hi,

I'm not a php wizard though I have read one book on php. I also code in asp.net

I want to understand when I include a file on a remote server, why do I get an error message of undefined function?

include "http://www.link-exchangers.com/fadmin/config.php";
include "http://www.link-exchangers.com/fadmin/functions.php";

$in_file = file_get_contents_me("http://www.link-exchangers.com/f/".$m_localTemplate);

When one includes a file, doesn't that stick all of the files available functions into memory?

Here is my error message:
Fatal error: Call to undefined function: file_get_contents_me() in /usr/local/4admin/apache/vhosts/sanjosecandle.com/httpdocs/links/add_link.php on line 8

In order for php to see my function, does it have to be on the local machine?

Re: Question regarding undefined function

Posted: Tue Sep 16, 2008 1:14 am
by adroit
Hi,

There is no function like file_get_contents_me() in PHP. The correct function is file_get_contents()

Regards

Re: Question regarding undefined function

Posted: Tue Sep 16, 2008 2:01 am
by linkexchangers
The function is in a file called functions.php my friend. It is not part of php.

Re: Question regarding undefined function

Posted: Tue Sep 16, 2008 4:33 am
by onion2k
The problem is that you're including the files with the full path ... "http://www.link-exchangers.com/fadmin/functions.php" ... that will make PHP go and fetch that page from the internet rather than from the filesystem, and as that page is basically blank when you view it online your functions aren't found. Include it as a local file, eg "./fadmin/functions.php".