Chat/send.php

21 lines
461 B
PHP
Raw Permalink Normal View History

2021-02-18 14:45:13 +00:00
<?php
//set error reporting
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
if ($_GET["userMessage"] == "") {
return;
}
$dateToWrite = date("Y-m-d H:i:s");
$array = array($_GET["userName"], $_GET["userMessage"], $dateToWrite, microtime());
//open csv file
//format is "user name", "user message", "Y-m-d H:i:s", "microtime"
fputcsv(fopen("messages.csv", "a+"), $array);
header("Location: index.php");
exit();
?>