0
Hello, I am developing this system for study purposes and whenever I try to do some operation like register, edit or delete I get the error message: "Fatal error: Call to Undefined Function usuario_logado() in /opt/lampp/htdocs/projects/estudandophp/menu_administrador.php on line 28" but the operation is completed. What I have researched is as if the class where the function is defined does not exist but I think that is not the case. What am I doing wrong? Below the screens to give a sense of what I’m doing:
Follow the application source code: Github
In the file menu_admin.php Voce this calling
usuario_logado()
but at no point in the file did you declare that function. To solve the problem, create the function in that file or use a require Iu include to include the file that has the user function– Leonardo
You must import the file
seguranca.php
using the methodrequire_once()
before using this function. Whenever you create a class or function in a separate file you should import it to the page you intend to use– Adriano Luz
Thanks for the feedback. So, I had not made the import because I am including the file 'menu_administrador.php' in 'menu.php' and there is what I am doing 'require' of 'segurnca.php'. Having said that I realized that the problem was that when I did some operation in the bank I was calling directly the page 'lista_alunos.php' and calling this way none of the imports were being made.
– Guilherme Ramalho