PDA

View Full Version : Fatal Error!



Dan
December 14th, 2009, 23:12
I am working on something and getting the following error:

Fatal error: Call to undefined function check_user() in /home/palshop/public_html/top.php on line 11

Here is Line 11 & 12 of top.php



if( !check_user($user) ) {
add_user( $user );


Anyone got any ideas on how this can be fixed? I know its something to do with MySQL Connect.

Any help would be greatly appreciated.

Thanks.

Dynash
December 14th, 2009, 23:38
Is add_user in a class/included, missing $this->?

If it's a in a class, remember to do the $class = new Class; $class->add_user($user);

(If it was an issue with MySQL, make sure you have the extension loaded in your ini. But, it would normally spout out the Undefined function mysql_connect.)

Dan
December 14th, 2009, 23:48
Nah didn't work. Sorry.
I tried the $class=add_user($user); and just got another fatal error:

Fatal error: Call to a member function check_user() on a non-object in /home/palshop/public_html/top.php on line 11

Starcraftmazter
December 15th, 2009, 00:24
Would you mind providing some context? The error is very simple, it means the function doesn't exist - ie. hasn't been defined.

themoose
December 16th, 2009, 10:50
Would you mind providing some context? The error is very simple, it means the function doesn't exist - ie. hasn't been defined.

Exactly...

You probably haven't included a file that contains the function check_user().

Richard
December 16th, 2009, 11:43
Nah didn't work. Sorry.
I tried the $class=add_user($user); and just got another fatal error:

Fatal error: Call to a member function check_user() on a non-object in /home/palshop/public_html/top.php on line 11

Where is add_user() defined? Is it defined in a class, are you trying to call the function from another function, is it outside of the class it exists in? Is it inside another class?

Dynash
December 16th, 2009, 13:17
Yeah, include it.


Is add_user in a class/included, missing $this->?