I want to combine my 2 PHP files into 1, which I’ve seen done, but can’t remember how or where. Here they are:
[code=html]<html>
<body>
<form action=”domath.php” method=”get” />
<p>
Miles: <input name=”distance” type=”text” value=”” size=”10″ maxlength=”10″ />
MPH:
<input name=”speed” type=”text” value=”22″ size=”10″ maxlength=”10″ />
<input type=”submit” value=”Submit” />
</p>
</form>
</body>
</html>
[code=php]<?php
$mile = $_GET[“distance”];
$mph = $_GET[“speed”];
$time = $mile / $mph * 60;
if ($time < 1)
{
$total = $time * 60;
$unit = ‘seconds’;
}
else
{
$unit = ‘minutes’;
$total = $time;
}
echo $total;
echo ‘ ‘;
echo $unit;
?>
So I have just one file, index.php (I’ll need to change domath.php to index.php)