I'm trying to embed some php code in a .html file but it doesn't seem to work. I read that in order for this to work the file has to be saved with the .php extension, but when I do that and open it up in a browser the browser just displays all my code. What am I doing wrong?
<!DOCTYPE HTML>
<html>
<head>
<title>Welcome</title>
<link rel="stylesheet" href="normalize.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<?php
$x = 3;
$y = 2;
$ans = $x + $y;
?>
<h1 style = "text-align: center;"> The answer is: <?php= $ans ?> </h1>
<section class="loginform cf">
<form name="start page" action="index_submit" method="get" accept-charset="utf-8">
<label style = "text-align: center;" >What type of property?</label>
<input type="button" value = "Commercial" onClick="parent.location='commercial.html'">
<input type="button" value = "Residential" onClick="parent.location='residential.html'">
</form>
</section>
</body>
</html>