php_ninja Posted January 25, 2008 Share Posted January 25, 2008 ok, i don't know what i am doing wrong here, have a look. i get a "call to undefined function: display_form_text()" <?php // class and function definitions for the id maker class formInfo { var $form_text = "form_email"; function __construct($email_in) { $this->form_text = $email_in; } function display_form_text() { print("ID for email address: "); print($this->form_text); } } $form_email = new formInfo($_POST['email']); $form_email = display_form_text(); ?> Quote Link to comment Share on other sites More sharing options...
KrisNz Posted January 25, 2008 Share Posted January 25, 2008 class methods are accessed with -> i.e $form_email->display_form_text(); Quote Link to comment Share on other sites More sharing options...
php_ninja Posted January 26, 2008 Author Share Posted January 26, 2008 thanks, i knew it was something easy. Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted January 26, 2008 Share Posted January 26, 2008 formInfo::display_form_text() does not return a value so assigning it's return value to a variable is of no use. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.