thank you tttony
Edit:
<?php
//Define Math Function
function doMath($fileSize, $uploaded, $downloaded) {
$totalDown = $fileSize + $downloaded;
$finalRatio = $uploaded / $totalDown;
}
if(isset($_POST) {
//Define Variables
$fileSize = $_POST['fileSize'];
$uploaded = $_POST['uploaded'];
$downloaded = $_POST['downloaded'];
$finalRatio = 1;
//Checks
if(is_numeric($fileSize) == FALSE){
$error = "Please enter a numeric value for File Size.";
}
if(is_numeric($uploaded) == FALSE){
$error = "Please enter a numeric value for Uploaded.";
}
if(is_numeric($downloaded) == FALSE){
$error = "Please enter a numeric value for Downloaded.";
}
if((isset($_POST) AND (is_numeric($downloaded)){
doMath($fileSize, $uploaded, $downloaded);
}
//Displays the values (optional)
echo $totalDown;
echo "<br />";
echo $finalRatio;
}
?>
<form action="index.php" method="post"> <!-- this is index.php -->
File Size: <input type="text" name="fileSize" />
Uploaded: <input type="text" name="uploaded" />
Downloaded: <input type="text" name="downloaded" />
<input type="submit" value="Submit" />
<input type="hidden" name="action" value="login" />
</form>
not fully done, few bugs but busy