brem13 Posted June 6, 2010 Share Posted June 6, 2010 getting Fatal error: Call to undefined function passchanger() in /home2/singlese/public_html/account.php on line 1309 code calling function if ($_SERVER['REQUEST_METHOD'] == 'POST') { $formValues = $_POST; $formErrors = array(); if ($_POST['passChange']) { if (!VerifyForm($formValues, $formErrors)) { DisplayForm($formValues, $formErrors); } passchanger(); } else ProcessForm($formValues); } function function passchanger() { setVisibility('passChanged', 'inline'); } Quote Link to comment https://forums.phpfreaks.com/topic/204024-fatal-error-call-to-undefined-function/ Share on other sites More sharing options...
ale8oneboy Posted June 6, 2010 Share Posted June 6, 2010 Does passchanger() reside in the same file or in an included file? If it's in an included file you might want to check that file. Quote Link to comment https://forums.phpfreaks.com/topic/204024-fatal-error-call-to-undefined-function/#findComment-1068603 Share on other sites More sharing options...
dabaR Posted June 6, 2010 Share Posted June 6, 2010 Reference: http://php.net/manual/en/function.function-exists.php , http://ca2.php.net/manual/en/function.include.php Quote Link to comment https://forums.phpfreaks.com/topic/204024-fatal-error-call-to-undefined-function/#findComment-1068605 Share on other sites More sharing options...
brem13 Posted June 6, 2010 Author Share Posted June 6, 2010 its in the same file Quote Link to comment https://forums.phpfreaks.com/topic/204024-fatal-error-call-to-undefined-function/#findComment-1068606 Share on other sites More sharing options...
dabaR Posted June 6, 2010 Share Posted June 6, 2010 its in the same file Oh, is it in the else case of the if ('POST' == $_SERVER['REQUEST_METHOD']) ? Quote Link to comment https://forums.phpfreaks.com/topic/204024-fatal-error-call-to-undefined-function/#findComment-1068609 Share on other sites More sharing options...
brem13 Posted June 6, 2010 Author Share Posted June 6, 2010 its here if ($_SERVER['REQUEST_METHOD'] == 'POST') { $formValues = $_POST; $formErrors = array(); if ($_POST['passChange']) { if (!VerifyForm($formValues, $formErrors)) { DisplayForm($formValues, $formErrors); } passchanger(); } else ProcessForm($formValues); } Quote Link to comment https://forums.phpfreaks.com/topic/204024-fatal-error-call-to-undefined-function/#findComment-1068610 Share on other sites More sharing options...
dabaR Posted June 6, 2010 Share Posted June 6, 2010 No, I saw that in your first post. I meant, is the function defined in a part of the code that does not get executed because $_SERVER['REQUEST_METHOD'] == 'POST' ? Quote Link to comment https://forums.phpfreaks.com/topic/204024-fatal-error-call-to-undefined-function/#findComment-1068615 Share on other sites More sharing options...
brem13 Posted June 6, 2010 Author Share Posted June 6, 2010 its only called when i choose to update the password which is happening, but it shows the error after the $_SERVER['REQUEST_METHOD'] == 'POST' has happened Quote Link to comment https://forums.phpfreaks.com/topic/204024-fatal-error-call-to-undefined-function/#findComment-1068619 Share on other sites More sharing options...
dabaR Posted June 6, 2010 Share Posted June 6, 2010 OK, let's try this: put echo 'the code that defines the function runs right after this'; on a line right before the function passchanger() { setVisibility('passChanged', 'inline'); } This I think will illustrate my point. Quote Link to comment https://forums.phpfreaks.com/topic/204024-fatal-error-call-to-undefined-function/#findComment-1068622 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.