Saving on text file

hey i have a form that gather any that user fill in

heres my front end form

<title>Untitled Document</title>

<form action=“test.php” method=“get”>
name <input name=“name” type=“text”><br>
<input name=“Submit” type=“submit” value=“submit”>

my php script


$name = $_POST[‘name’];

$handle = fopen(“names.txt”, “a” );
fwrite($handle, "$name
" );

echo $name


i want whatever the user fill in it will save it in the file and it will append ather user fill ine again and then display it
this code seems dont to work and i dont know why?