Page 1 of 1

PHP require_once isnt finding a function :(

Posted: Sat Mar 26, 2011 6:24 am
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 :)

Re: PHP require_once isnt finding a function :(

Posted: Sat Mar 26, 2011 5:02 pm
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?