WebServ/www/public/M3/06/saveMsg.php

20 lines
543 B
PHP
Raw Normal View History

2024-09-09 12:19:57 +00:00
<?php
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
$name = "<hr><p>Från: " . $_SESSION['username'] . "</p>";
$msg = "<p>" . cleanData($_POST['message']) . "</p>";
2024-09-13 12:56:16 +00:00
file_put_contents("../../../userData/M3-06-messages.dat", $name . $msg, FILE_APPEND);
2024-09-09 12:19:57 +00:00
header("location: index.php?page=klotter"); //Omdirigerar till klotterplanket
function cleanData($data)
{
$data = strip_tags($data);
$data = htmlspecialchars($data);
$data = trim($data);
$data = stripslashes($data);
return $data;
}