I am trying to dynamically update my poll results and am having some issues. What I want to form to do is on submit, increment the variable by 1 and then display the variable onto the screen. Here is the code if anyone can see the problem.
<!-- if statement for radio1 -->
<input type="radio" name="mountain" value="mountain1">Blue Mountain<br>
<?
if (mountain1 == "checked")
{
for (i = 0, i < 200, i++)
{
$blue = $blue + i;
}
}
?>
<!-- if statement for radio2 -->
<input type="radio" name="mountain" value="mountain2">Horse Shoe<br>
<?
if (mountain2 == "checked")
{
for (i = 0, i < 200, i++)
{
$horse = $horse + i;
}
}
?>
<!-- if statement for radio3 -->
<input type="radio" name="mountain" value="mountain3">Glen Eden<br>
<?
if (mountain1 == "checked")
{
for (i = 0, i < 200, i++)
{
$glen = $glen + i;
}
}
?>
<!-- if statement for radio4 -->
<input type="radio" name="mountain" value="mountain4">The All Bite<br>
<?
if (mountain4 == "checked")
{
for (i = 0, i < 200, i++)
{
$bite = $bite + i;
}
}
?>
<input type="submit" name="submitform" value="submit">
<input type="reset" name="reset" value="reset"></form>
<hr color="white">
<center><b><u>Poll Results</u></b></center>
<?
Echo "Blue = $blue<br>";
Echo "Horseshoe = $horse<br>";
Echo "Glen Eden = $glen<br>";
Echo "They all bite = $bite<br>";
?>
I think the for loop is screwed but Im not to sure. Any help would be appreciated