chat_20211013235252.php 981 Bytes
<?php
$msg= $_GET['msg'];
$logUserid= $_GET['logUserid'];
$chatBot = 1100;

$str = str_replace(' ', '%', $msg);
$requestingURL='http://127.0.0.1:5000/'.$str;

            $curl = curl_init();

            curl_setopt_array($curl, array(
            CURLOPT_URL => $requestingURL,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_ENCODING => '',
            CURLOPT_MAXREDIRS => 10,
            CURLOPT_TIMEOUT => 0,
            CURLOPT_FOLLOWLOCATION => true,
            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
            CURLOPT_CUSTOMREQUEST => 'GET',
            CURLOPT_HTTPHEADER => array(
                'Content-Type: application/json'
            ),
            ));


            

            $response = curl_exec($curl);
            echo $response;

            $sql1 = "INSERT INTO `chat_details`(`logUserid`, `chatBot`, `msg`, `date`, `time`, `datetime`) VALUES ('$logUserid', '$chatBot', '$msg', '$date', '$time', '$datetime')";
          
?>