I have my form all made up, I named all the radio buttons and everything (
www.mygpop.net/test.php). Now the problem is the results. This is the code I have so far:
Code:
<?php
$water = 0;
$earth = 0;
$fire = 0;
$air = 0;
$night = 0;
$light = 0;
$i = 1;
$q = "q".$i;
for ($i=1; $i=10; $i++)
{
switch ($_POST[$q])
{
case 1:
$water = $water + 1;
break;
case 2:
$earth = $earth + 1;
break;
case 3:
$fire = $fire + 1;
break;
case 4:
$air = $air + 1;
break;
case 5:
$night = $night + 1;
break;
case 6:
$light = $light + 1;
break;
}
}
echo "water ".$water."<br />";
echo "earth ".$earth."<br />";
echo "fire ".$fire."<br />";
echo "air ".$air."<br />";
echo "night ".$night."<br />";
echo "light ".$light."<br />";
?>
I want it basically to go through every question (the names of the radio button groups are q1 to q10) and if the answer is a certain element, I want it to add to that element's count. The case numbers refer to the values I used in place of the element names on the form. I don't know what to do, I keep getting fatal errors saying that it exceeded 30 seconds. Can someone help me out a little?