Vote(poll) PHP not working
<p>I have a problem with a vote thing in php</p>

<p>the code of my page is:</p>

<pre><code>      $active = '1';
      $data = time();
      $autor = $_SESSION['username'];
      $question = $_POST['question'];

$contador = 2;
    $contagem = '0';
    while ($contagem &lt;= $resps) {
    $contagem++;~
    $contador++;
    $question = $_POST['question'];
    $choice = $contagem;
    $teste = "choice$contador"; 
    $choice = $_POST['$teste']; 
    $activity = $_POST['question'];

    $votes = '0';
    $q2 = "INSERT INTO poll_answers (choice, activity, votes) VALUES ('$choice', '$activity', '$votes')";
    if($database-&gt;query($q2)){echo "sucssso answews";}else{echo "falha answrrs";}
    $contador++;
    }
    $q = "INSERT INTO poll_questions (question, active) VALUES ('$activity', '$active')";
    if($database-&gt;query($q))
    { echo "sucesso questoes";}
    else{ echo"falha questoes";}


    echo "inserido";

?&gt;

&lt;form action="" name="votacao2" method="post"&gt;
&lt;table&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Pergunta&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;textarea name="question" cols="50" rows="1"&gt;&lt;/textarea&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;?php
$contador = '2';
$respos = $resps + 2;
while ($contador &lt; $respos) {
$contador++;
echo "&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Resposta&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;textarea name=\"choice$contador\" cols=\"50\" rows=\"1\"&gt;&lt;/textarea&gt;
&lt;/td&gt;&lt;/tr&gt;
";
}
?&gt;
&lt;tr&gt;&lt;td&gt;&lt;input type="submit" name="enviar" value="Enviar" /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
</code></pre>

<p>I think the only thing not working is this:</p>

<pre><code>$teste = "choice".$contador;
$choice = $_POST['$teste']; 
</code></pre>

<p>And I don«t know how to do it, so once again I ask your help. </p>

<p>Thanks in advance :)</p>

<p>I edit this post, so now I hope you understand my problem, I'm tryinmg  to do a poll and it isnt working, when I insert the data, the row choice has a 0 in it, I can see it in phpmyadmin.</p>
