> 7. Error reads - "undefined function or variable".
Please copy the complete message. Sometimes there is a subtle difference between the exact message and the thing one means to have read (sorry, I have the strong impression, that this is not English anymore - I want to say: While it is in general a good idea to think before posting, for error messages it is the other way around: post instead of thinking.).
Something strange happens, so a tiny detail may carry the important hint.