The following code worked a couple of days ago, but now it doesn't work. It does not write anything to the txt file. The html page created by the php reads the msg variable, but it is not written to the txt file. It's really frustrating, please help! I am using a server to run the code, so that shouldn't be the problem. Besides, it did work some time ago.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<h2>Skriv dit blogindlæg her!</h2>
<form action="Miniprojekt.php" method="get">
<textarea class="tekstfelt" type="text" name="msg"></textarea>
<input class="knap" type="submit" value="Udgiv"/>
</form>
</body>
</html>
<?php
if(isset($_GET["msg"])){
$fh = fopen("messages.html", "a");
fwrite($fh, $_GET["msg"]);
fclose($fh);
}
echo file_get_contents("messages.html");
?>