PHP require_once isnt finding a 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
bian101
Forum Newbie
Posts: 19
Joined: Fri Aug 20, 2010 9:05 am

PHP require_once isnt finding a function :(

Post by bian101 »

Hi guys,

Basically this is what im saying in short. Lets assume i have 2 files.. file.php and signup_model.php

file.php says (an example in brief)

Code: Select all

require_once( $_SERVER['DOCUMENT_ROOT'] . "x/classes/models/signup_model.php" );          // yes i know its messy any help how to avoid it because using ../ wont work because its more than 1 step up   
then below i have

Code: Select all

example_function($me['first_name'], $me['last_name'], $me['id']);
In signup_model.php i have

Code: Select all

class signup_model extends model
	{
	function example_function($local_first_name, $local_last_name, $local_id){
 // code is in here
	}

and im getting:
[text]Fatal error: Call to undefined function create_new_user_from_facebook() in C:\wamp\www\x\modules\openid\fb_login.php on line 109[/text]

Any ideas?


Ian :)
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: PHP require_once isnt finding a function :(

Post by social_experiment »

The error you are receiving indicates that the function you want to execute hasn't been defined anywhere in the class. What does your model class look like?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Post Reply