I am in the process of developing a website for my church and have tried commenting out the php code and then the error goes away the code is needed to send the form to my server problem is I keep on getting http error 500
<!DOCTYPE html>
<head>
</head>
<body>
<h1 align="center" class="heading">Welcome to church</h1><br>
<div align="center" class="about">
We are an ethiopian orthodox church which holds service evrey sunday
</div>
<div align="center" class="mapsapi">
<h3>Contact us</h3>
<form method="post" name="form" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
<input type="text" name="firstname" placeholder="Firstname"><br>
<input type="email" name="email" placeholder="Email"><br>
<input type="submit">
<br>We are based in<br>
St Micheals Road, nw2 6xg
<br>
<br>
<iframe src="https://maps.google.com/maps?q=nw2%206xg&t=&z=13&ie=UTF8&iwloc=&output=embed" id="gmap_canvas" scrolling="no" style="width: 600px; height: 400px;" frameborder="0"></iframe><a href="https://embedgooglemap.github.io" style="display:none;">map generator</a><br>
</div>
<?php
if(isset($_POST["form"])) {
$form = $_POST["form"];
$fistname = $_POST["firstname"];
$email = $_POST["email"];
if ($formss == TRUE) {
$file = fopen("contactdetails", "a");
fwrite($file, $firstname);
fwrite($file, $email);
fclose($file);
header('Location: ' . $_SERVER['SCRIPT_NAME']);
?>
Please help