How to export input html data to txt by php (problem)

i found this code on internet and i want to have these inputs:
name
check box with 5 items

this code saves user’s info that selected in checkbox and his name in a text file

can someone help me to fix this?

<!DOCTYPE html>
<?php
if(isset($_POST['submit'])){
$Name = "Username:".$_POST['username']."
";
$Pass = "Password:".$_POST['password']."
";

$file=fopen("saved.txt", "a");
fwrite($file, $Name);
fwrite($file, $Pass,);
echo fwrite($file,"*************************",);
fclose($file);
}
?>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $('.check').click(function() {
        $('.check').not(this).prop('checked', false);
    });
});
</script>
<BODY>

<form action = "post.php" method="POST">

    <p>
        <label>Login Name:</label><input type = "text"  name = "name" /><br>

<input type="checkbox" type = "password"  name="pwd[]" class="check" value="male"> Male
<input type="checkbox" type = "password"  name="pwd[]" class="check" value="female"> Female
<input type="checkbox" type = "password"  name="pwd[]" class="check" value="other"> Other

        <br/>
        <br/>
    </p>
    <input type = "submit" name="submit_btn" id = "submit" value = "submit"/>
    <input type = "reset"  id = "reset" value = "reset"/>
</form>
</BODY>
</html>