<?php
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: Content-Type");
header("Content-Type: text/plain");

// Read the request body
$requestBody = file_get_contents('php://input');

// Log the received text
file_put_contents('received_text.log', $requestBody . PHP_EOL, FILE_APPEND);

// Display the received text on the page
echo "Received textyyy: " . $requestBody;
?>