I am new and I have an error in the platform that I am programming with php, this error appears to me now, I already put the permissions to the folders and the files, in my localhost it works perfect the error is in the server what is with IIS8
-
POST http: //*******/Controller/Login/Login.php 500 (Internal Server Error) jquery-3.3.1.js: 9600. I know that the ajax function is working well because throws me the error message I put on it
so you see the error in the chrome console
is a form that sends 2 fields the post,
here my code
so you see the error in the chrome network
ajax function
//---------------- FUNCION AJAX ------------------//
function fajax(url, parametros, metodo) {
$.ajax({
url: url,
data: parametros,
type: 'post',
cache: false,
beforeSend: function () {
$(document).ajaxStop();
$(document).ajaxStart();
},
dataType: 'html',
contentType: 'application/x-www-form-urlencoded; charset=utf-8;',
timeout: 8000,
success: function (datos) {
metodo(datos);
},
error: function (xhr, status) {
alert("Por favor, valida tu conexión !")
}
})
}
login function
//-------------- LOGIN ------------------------//
var url = "index.php";
var parametros = "acceso=true";
var metodo = function (datos) {
$("#login").validate({
rules: {
correo: {required: true, email: true},
contrasena: {required: true, minlength: 3}
},
messages: {
correo: {
required: '<font color="red"> Debe colocar elcorreo</font>',
email: '<font color="red">Debe colocar su correo electronico</font>',
},
contrasena: {
required: "Debe colocar una contraseña",
minlength: '<font color="red">Debe colocar minimo 3 cracteres</font>',
},
},
submitHandler: function () {
var url = "Controller/Login/Login.php";
var parametros = $("#login").serialize();
var metodo = function (datos) {
datos = $.parseJSON(datos);
if (datos.success == "ok") {
if (datos["result"][0]["lenguaje"] == 'SPANISH') {
// alerPos("Perfecto !", "<b>" + datos["result"][0]["NombreColabora"] + " " + datos["result"][0]["ApellidoColabora"] + " Bienvenido</b>");
setTimeout("location.href='Pages/Main.php'", 1000);
} else {
// alerPos("Excellent !", "<b>" + datos["result"][0]["NombreColabora"] + " " + datos["result"][0]["ApellidoColabora"] + " Welcome</b>");
setTimeout("location.href='EN/Pages/Main.php'", 1000);
}
} else {
alerNeg("Error ", "<br>error, it is not possible to enter.<br>");
}
};
fajax(url, parametros, metodo);
}
});
};
fajax(url, parametros, metodo);
Controller
<?php
if ($_POST) {
ob_start();
session_start();
//session_name("seExtra");
require '../../CLASS/BD/datos.php';
require '../../CLASS/BD/MySQLi.php';
require '../../CLASS/VO/ColaboradorVO.php';
require '../../CLASS/DAO/loginDAO.php';
ini_set('display_errors', 1);
$ColaboraVO = new LoginDAO();
$data = json_encode($_POST);
$json = json_decode($data);
$ColaboraVO->Login($json);
} else { header("location:../.././");}
I hope you can help me soon, I appreciate your help beforehand