Hi yizzle.

Anyway... Here is my problem. I have a class called Validate that has a
method called ValidateInput. There is another method in this class
called phonenumber. ValidateInput calls phonenumber at some point like
this $this->phonenumber($input);.

In my page I'm trying to use this class without instantiating an object.
Like so:

(keep in mind ValidateInput will return true or false.)

if(Validate::ValidateInput($input, "phone"))
{
        echo "valid";
}
else
{
        echo "invalid";
}

I get an error that says "Call to a member function on a non-object".
This error is pointing to the $this->phonenumber($input); call in the
ValidateInput method.

Does this mean that one method cannot call another method in the same
class unless that class in instantiated into an object? Or does it mean
I'm just being brain dead and doing something wrong?


Thanks,
Chris.

p.s. I was looking for this answer on my own but I forgot what the ::
notation is called and "double colon" didn't do it.

--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to