i am writing a unit converter php program. i have the set up of the page, but it seems like my php file is not being found. when i click the submit button i am brought a an error page. this is my html code.
<html>
<head>
</head>
<body>
<form action="hw7.php" method="post">
<h2>Convert length:</h2>
<p>Select conversion direction: <br />
<input type="radio" name="dir" value="1"
checked="checked"/> Feet to meters<br />
<input type="radio" name="dir" value="2" /> Meters to feet<br
/>
</p>
<p>Value to be converted: <br /><input type="text"
name="cvalue" /></p>
<p><input type="submit" value="Convert" /></p>
</form>
</body>
</html>
and here is my php file
<?php
$fTOm = $_POST["cvalue"] * 3.2808;
$mTOf = $_POST["cvalue"] / 3.2808;
echo "Result: ";
if ($POST[ 'dir'] == "1") <?php echo "$_POST["cvalue"]; ?> feet = <?php echo "fTOm"; ?> meters;
?>
Your PHP script is likely causing a server error due to improper coding. Check your server logs for PHP related errors, and possibly turn on error_reporting for PHP.
Within your PHP script, you have a statement of:
Since you’re already in a PHP script, why are you using the
<?php echoinline anifstatement?? Correct this issue and try running the script by directly calling it.Change the if line to :