so I’m new to php and I’m working on a school task. Its a simple form that will take the inputs and write it to a txt file. But for me it doesn’t work. I tried to make a test version to see where the problem is and the error i get is 405 method not allowed. I have used fopen and fwrite too but they dont work too.
Here is my html code
<!DOCTYPE html>
<html lang="No">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Index1</title>
</head>
<body>
<form method="post" action="test21.php" name="myForm">
klassekode <input type="text" id="klassekode" name="klassekode" required />
<input type="submit" value="Fortsett" id="fortsett" name="fortsett" />
</form>
<a href="klasse.txt">Vis klasser </a>
</body>
</html>
and my very simplified php code that i used to test test21.php
<?php
file_put_contents("klasse.txt", "test");
?>
