我有一个HTML页面,其中包含可供选择的单选按钮。一个是年龄范围,另一个是工资范围。这些是由php文件处理的,我想要做的是能够打印
关于用户如何与他/她年龄的中位数进行比较的声明
到目前为止,我只打印用户的年龄范围和工资范围。我无法弄清楚如何打印其他的。
<table>
<tr>
<td>
Age Range</td>
<td colspan="2">
Salary Range</td>
</tr>
<tr>
<td>
<input id="Radio1" checked="checked" name="R1" type="radio" value="V1" />15 to
24 Years</td>
<td>
<input id="Radio7" checked="checked" name="R7" type="radio" value="V1" />$15,000
to $24,999</td>
<td>
<input id="Radio13" name="R7" type="radio" value="V1" />$75,000
to $84,999</td>
</tr>
<tr>
<td>
<input id="Radio2" name="R1" type="radio" value="V1" />25 to
34 Years</td>
<td>
<input id="Radio8" name="R7" type="radio" value="V1" />$25,000
to $34,999</td>
<td>
<input id="Radio14" name="R7" type="radio" value="V1" />$85,000
to $94,999</td>
</tr>
<tr>
<td>
<input id="Radio3" name="R1" type="radio" value="V1" />35 to
44 Years</td>
<td>
<input id="Radio9" name="R7" type="radio" value="V1" />$35,000
to $44,999</td>
<td>
<input id="Radio15" name="R7" type="radio" value="V1" />$95,000
to $104,999</td>
</tr>
<tr>
<td>
<input id="Radio4" name="R1" type="radio" value="V1" />45 to
54 Years</td>
<td>
<input id="Radio10" name="R7" type="radio" value="V1" />$45,000
to $54,999</td>
<td>
<input id="Radio16" name="R7" type="radio" value="V1" />$105,000
to $114,999</td>
</tr>
<tr>
<td>
<input id="Radio5" name="R1" type="radio" value="V1" />55 to
64 Years</td>
<td>
<input id="Radio11" name="R7" type="radio" value="V1" />$55,000
to $64,999</td>
<td>
<input id="Radio17" name="R7" type="radio" value="V1" />$115,000
to $124,999</td>
</tr>
<tr>
<td>
<input id="Radio6" name="R1" type="radio" value="V1" />65
Years and Older</td>
<td>
<input id="Radio12" name="R7" type="radio" value="V1" />$65,000
to $74,999</td>
<td>
<input id="Radio18" name="R7" type="radio" value="V1" />$125,000
and up</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<input type="submit" name="submit" value="See Where You Stand">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Income</title>
<style>
body { font-family: Helvetica, Arial, sans-serif; }
body { font-size: 85%; }
</style>
</head>
<body style="background-color:lightgray; ">
<form action="AgeGroupSalaryRange.php" method="post" name="agegroup">
<h1>Income</h1>
<table>
<tr>
<td>
Age Range</td>
<td colspan="2">
Salary Range</td>
</tr>
<tr>
<td>
<input id="Radio1" checked="checked" name="R1" type="radio" value="V1" />15 to
24 Years</td>
<td>
<input id="Radio7" checked="checked" name="R7" type="radio" value="V1" />$15,000
to $24,999</td>
<td>
<input id="Radio13" name="R7" type="radio" value="V1" />$75,000
to $84,999</td>
</tr>
<tr>
<td>
<input id="Radio2" name="R1" type="radio" value="V1" />25 to
34 Years</td>
<td>
<input id="Radio8" name="R7" type="radio" value="V1" />$25,000
to $34,999</td>
<td>
<input id="Radio14" name="R7" type="radio" value="V1" />$85,000
to $94,999</td>
</tr>
<tr>
<td>
<input id="Radio3" name="R1" type="radio" value="V1" />35 to
44 Years</td>
<td>
<input id="Radio9" name="R7" type="radio" value="V1" />$35,000
to $44,999</td>
<td>
<input id="Radio15" name="R7" type="radio" value="V1" />$95,000
to $104,999</td>
</tr>
<tr>
<td>
<input id="Radio4" name="R1" type="radio" value="V1" />45 to
54 Years</td>
<td>
<input id="Radio10" name="R7" type="radio" value="V1" />$45,000
to $54,999</td>
<td>
<input id="Radio16" name="R7" type="radio" value="V1" />$105,000
to $114,999</td>
</tr>
<tr>
<td>
<input id="Radio5" name="R1" type="radio" value="V1" />55 to
64 Years</td>
<td>
<input id="Radio11" name="R7" type="radio" value="V1" />$55,000
to $64,999</td>
<td>
<input id="Radio17" name="R7" type="radio" value="V1" />$115,000
to $124,999</td>
</tr>
<tr>
<td>
<input id="Radio6" name="R1" type="radio" value="V1" />65
Years and Older</td>
<td>
<input id="Radio12" name="R7" type="radio" value="V1" />$65,000
to $74,999</td>
<td>
<input id="Radio18" name="R7" type="radio" value="V1" />$125,000
and up</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<input type="submit" name="submit" value="See Where You Stand">
</form>
</body>
</html>
这是php代码
<?php
$agerange = $_POST['R1'];
$incomerange = $_POST['R7'];
/*$mediansalary = */
?>
<?php
AgeBrackets: ("15 to 24 Years", "25 to 34 Years", "35 to 44 Years", "45 to 54 Years", "55 to 64 Years", "65 Years and Older");
MedianIncome: (34311, 52702, 64973, 67141, 57538, 35611);
IncomeRangesStart: (15000, 25000, 35000, 45000, 55000, 65000, 75000, 85000, 95000, 105000, 115000, 125000);
?>
答案 0 :(得分:2)
此函数将返回值数组的中位数。
collection.reloadData()
我很难理解你的表单/代码,看看这个数组可能是什么,但希望这会有所帮助。