Error include_once using AJAX

Asked

Viewed 107 times

0

The code is on the link because is in a folder system.

PROBLEM:

I have an MVC architecture.Inside the view I have a class that contains a registration form that is in the initial tela_class.The form field data are sent to a script that contains an ajax this ajax will send the information to the class user control and then there will be a return to script by function (done).

The error is happening in the User class ,every time I try include the connection class present in the Singleton package get an error which is issued by the done function of ajax.

In the code I left commented the inclusion but you can remove the comment include_once of the User class and insert the data ,which will see the error. This is the error image when I include the connection class: inserir a descrição da imagem aqui

ARCHIVE LINK

1 answer

0


Thiago downloaded your system and debugged, put the class Conexao.php inside where Usuario_dao.php is, and did the following include:

include 'Conexao.php';

soon after that the test Alert worked normally. ie the code was ok

But for you to resolve your error, you are with classic URL error, put the absolute url, (I did this on your system and it worked)

include($_SERVER['DOCUMENT_ROOT']."/APP/MODEL/SINGLETON/Conexao.php");
  • I used the absolute url and it worked. Thanks!

  • is nois Thiago! thanks for considering as a response and voting as useful :D

Browser other questions tagged

You are not signed in. Login or sign up in order to post.