<?php 
    session_start();
        require('conexion.php'); // Incluye la conexión a la base de datos
        $outgoing_id = $_SESSION['id_usuario'];//envia
        $incoming_id = mysqli_real_escape_string($conn, $_POST['incoming_id']);//recibe
        $message = mysqli_real_escape_string($conn, $_POST['message']);
        if(!empty($message)){
            $sql = mysqli_query($conn, "INSERT INTO messages (incoming_msg_id, outgoing_msg_id, msg)
                                        VALUES ({$incoming_id}, {$outgoing_id}, '{$message}')") or die();
        }



    
?>
