This is what i got so far... but how do i assign the 'how_man' input box to multiply against the $seconds variable based on whatever is input in the 'how_many' input box? I hope this makes sense.. i need help. thanks in advance.
PHP Code:
<table>
<form name="calc" action="<?php echo matry::here(array('page'=> 'calc')); ?>" method="POST">
<tr><td><?php inp('how_many'); ?></td><td> * <?php echo $seconds; ?></td></tr>
<tr><td>This many Seconds:</td></tr> <?php echo $result; ?>
<tr><td>This many Minutes:</td></tr>
<tr><td>This many Hours:</td></tr>
<tr><td>This many FTE:</td></tr>
<tr><td><input type="submit" value="Calc" name="submit" /></td></tr>
</form>
</table>
<?php
$page = $_GET['calc'];
// Defining the "calc" class
class calc {
var $how_many;
var $seconds;
function multiply($how_many,$seconds)
{
$result =$how_many * $seconds;
echo("The product of $how_many and $seconds is $result<br><br>");
echo("$how_many x $seconds = $result");
exit;
}
}
$calc = new calc();
foreach($how_many['how_many'] as $result) {
echo $result['seconds'], '<br>';
}
?>
<?php
if($page == "calc"){
$how_many = $_POST['how_many'];
$seconds = $_POST['seconds'];
if($oper == "multiply"){
$calc->multiply($how_many,$seconds);
}
}
?>
Bookmarks