21 lines
461 B
PHP
21 lines
461 B
PHP
<?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();
|
|
?>
|