Question regarding undefined function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
linkexchangers
Forum Newbie
Posts: 2
Joined: Mon Sep 15, 2008 11:47 pm

Question regarding undefined function

Post 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?
adroit
Forum Commoner
Posts: 37
Joined: Fri Aug 08, 2008 1:25 am
Location: India
Contact:

Re: Question regarding undefined function

Post by adroit »

Hi,

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

Regards
linkexchangers
Forum Newbie
Posts: 2
Joined: Mon Sep 15, 2008 11:47 pm

Re: Question regarding undefined function

Post by linkexchangers »

The function is in a file called functions.php my friend. It is not part of php.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Question regarding undefined function

Post 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".
Post Reply