Chat/messages.php

15 lines
427 B
PHP
Raw Normal View History

2021-02-18 14:45:13 +00:00
<?php
$message_file = fopen("messages.csv", "r");
while (($messages = fgetcsv($message_file)) !== FALSE) {
if ($messages[0] == "") {
$userName = "anon";
} else {
$userName = $messages[0];
}
echo("<p style='color: red;'>" . $userName . " says:</p><p>" . $messages[1] . "</p><p style='color: red;'>At: " . $messages[2] . "</p><hr>");
}
?>
<script>
window.scrollTo(0,document.body.scrollHeight);
</script>
<?php return; ?>