AJAX POST gives error 500 in HTTPS, but not in HTTP

0

A month ago I changed the HTTP server to HTTPS (SSL), although I do not know if it will have to see. The case is that a small application that had programmed in very rudimentary web, but it worked well in November. Today I reopened it, and it does not work.

Among other things, the first screen is a user request and password. When sending this data, I do a check by AJAX against a mysql database, to verify that the user exists, and thus be able to continue. Well that does not work anymore.

JQUERY Code: $("#confirmarUSUARIO").click(function() { usuario = $("#txtUSUARIO").val(); password = $("#txtPASSWORD").val(); $.ajax({ type: 'POST', url: "inc/confirmarUSUARIO.php", data: {usuario:usuario,password:password}, success: function(confirmacion){ if(confirmacion) { window.location.href = "consultas.html"; } else { location.reload(); } }, }); });

Confirm USUS.php code require 'conexion.php'; $usuario = $_POST['usuario']; $password = $_POST['password']; $datos = confirmarUSUARIO($pdo,$usuario,$password); echo $datos;

Confirm USER code within connection.php function confirmarUSUARIO($pdo,$usuario,$password) { $sentencia = $pdo->prepare("SELECT * FROM usuarios WHERE usuario=? AND password=?"); $sentencia->bindParam(1, $usuario); $sentencia->bindParam(2, $password); $sentencia->execute(); if($sentencia->rowCount()==0) { $datos = false; } else { $datos = true; } return $datos; }

As you can see, it's rudimentary, but for a couple of bullshit things I have to do with it, it goes fast and works well.

Now, after switching to SSL, it gives me an error 500.

Does anyone have any idea why it happens?

NOTE: I have a duplicate of everything on the local machine running with XAMPP and it works without problems.

$ pdo I initialize it in conexion.php $ pdo = new PDO ('mysql: host ='. $ host. '; dbname ='. $ database, $ user, $ password); $ pdo-> setAttribute (PDO :: ATTR_ERRMODE, PDO :: ERRMODE_EXCEPTION);

On the other hand, the database is the same in server as in local, with the difference of connection data

$ pdo I initialize it in conexion.php $pdo = new PDO('mysql:host='.$host.';dbname='.$database, $usuario, $password); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

On the other hand, the database is the same in server as in local, with the difference of connection data

    
asked by monicapo 04.01.2018 в 13:07
source

0 answers