So I recently ran into the problem of trying to grab $_REQUEST variables from a page and use them in a function on the same page. My error was Fatal error: Call to undefined function myFunction...
The structure of my code was check if the request had been submitted and perform page logic, otherwise display the form. The apparent problem was that my function was inside the page logic after the if statement checked for the request. Because it was after the if statement it never got parsed ahead of time and therefore never really existed before the call was made.
To fix the problem I simply moved my function to the top of my pHp code (before the if statement) and everything works fine.
Thursday, October 23, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment