|
|
|
|
![]() ![]() |
Oct 26 2005, 12:03 PM
Post
#1
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 407 Joined: 13-December 04 Member No.: 2,696 |
I've got the following function, that has a function inside of it, when I run it I get the followin error:
PHP Code: CODE Fatal error: Call to a member function on a non-object in See the code below where I get the error message. I'm guessing the scope of my varaibles is messed up, but I'm not sure how to fix it. I've abbreviated the code so as to make it easier to read. PHP Code: CODE function getMemberRegistrationForm( &$tpl, &$db ) { function displayRegistrationForm( $action, &$db, $defaults = NULL, $id = NULL ) { global $registrationForm; $registrationForm = new HTML_QuickForm('registrationForm'); $registrationForm->addElement('text', 'lname', 'Last Name:', array('size' => 40, 'maxlength' => 255 )); } if( $registrationForm->validate() ) // <-This is where I get an error { $registrationForm->freeze(); } else { displayForm( $registrationForm, $tpl, 'additional_content'); } } getMemberRegistrationForm( $tpl, $db); Thanks,kvarnerexpress |
|
|
|
Oct 27 2005, 11:36 PM
Post
#2
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: Members Posts: 73 Joined: 21-September 05 Member No.: 12,113 |
*BLEEP*ing hell. What is your registrationForm's source. Does it include that Validate() functuon???
|
|
|
|
Oct 29 2005, 08:53 AM
Post
#3
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 362 Joined: 2-March 05 From: The Netherlands Member No.: 4,097 |
First of all, sorry if i confuse you, i dont work with such codes (->,=>)
Shouldn't the call to validate() need variables provided to send to ? Check if you defined all your functions correctly, check the following: *validate() *freeze() *displayForm() Hope this helps, even a little bit :/ |
|
|
|
Nov 3 2005, 09:13 AM
Post
#4
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 162 Joined: 1-November 05 From: SATA II Member No.: 13,683 |
hi, kvarnerexpress
i dont think that a function can within another function. but following the error displayed, it should be mean you have try to call an method but that method not included in a object ==> the HTML_QuickForm might not be a class. try search if it found HTML_QuickForm class or not. - hope this help |
|
|
|
Nov 4 2005, 01:14 AM
Post
#5
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 123 Joined: 5-September 05 Member No.: 11,522 |
All I can think of is if validate() is a function that exists (and your other functions also exist) when the getMemberRegistrationForm() function executes...
Sorry I can't help much...but good luck!! |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 6th September 2008 - 06:14 PM |