Weight Distribution Calculator
[insert_php]//===============================================
//—————————————-
//percent of weight on wheels = weight on wheels / overweight x 100
if($_POST[‘a’] == “wwp”)
{
$wwp_weight_on_wheels = $_POST[‘wwp_weight_on_wheels’];
$wwp_overall_weight = $_POST[‘wwp_overall_weight’];
$wwp_errors = 0;
if($_POST[‘wwp_weight_on_wheels’] == “”) {$wwp_errors++;}
else { if(!is_numeric($_POST[‘wwp_weight_on_wheels’])) {$wwp_errors++;} }
if($_POST[‘wwp_overall_weight’] == “”) {$wwp_errors++;}
else { if(!is_numeric($_POST[‘wwp_overall_weight’])) {$wwp_errors++;} }
if($wwp_errors != 0) {$wwp_error_msg = “Please enter proper values!”;}
else
{
$total_wheel_weight_percentage = $_POST[‘wwp_weight_on_wheels’] / $_POST[‘wwp_overall_weight’] * 100;
$view_total_wheel_weight_percentage = ” Wheel Weight Percentage = “.$total_wheel_weight_percentage.”%”;
}
}
//—————————————-
//increased weight on wheels = [ distance of cg from wheels / wheelbase x weight ] + weight
if($_POST[‘a’] == “iww”)
{
$iww_distance = $_POST[‘iww_distance’];
$iww_weight = $_POST[‘iww_weight’];
$iww_wheelbase = $_POST[‘iww_wheelbase’];
$iww_errors = 0;
if($_POST[‘iww_distance’] == “”) {$iww_errors++;}
else { if(!is_numeric($_POST[‘iww_distance’])) {$iww_errors++;} }
if($_POST[‘iww_weight’] == “”) {$iww_errors++;}
else { if(!is_numeric($_POST[‘iww_weight’])) {$iww_errors++;} }
if($_POST[‘iww_wheelbase’] == “”) {$iww_errors++;}
else { if(!is_numeric($_POST[‘iww_wheelbase’])) {$iww_errors++;} }
if($iww_errors != 0) {$iww_error_msg = “Please enter proper values!”;}
else
{
$total_increased_weight_on_wheels = ($_POST[‘iww_distance’] / $_POST[‘iww_wheelbase’] * $_POST[‘iww_weight’]) + $_POST[‘iww_weight’];
$view_total_increased_weight_on_wheels = ” Increased Weight on Wheels = “.$total_increased_weight_on_wheels;
}
}
//===============================================
$content = ‘
‘;
$content = addslashes($content);
$content = “\$result=\””.$content.”\”;”;
eval($content);
print stripslashes($result);
[/insert_php]
