// Handle form submission if ($_SERVER["REQUEST_METHOD"] == "POST") { if (isset($_POST["message"]) && !empty($_POST["message"])) { $message = $_POST["message"]; $time = date("H:i:s"); // Append message to chat log file file_put_contents("chat_log.txt", "$time - {$_SESSION['username']}: $message\n", FILE_APPEND); } } ?>

Message sent successfully!

Back to Chat