Defining variables

2 posts by 1 authors in: Forums > CMS Builder
Last Post: April 16, 2009   (RSS)

Re: [rjbathgate] Defining variables

By rjbathgate - April 16, 2009 - edited: April 16, 2009

Sorted it!!!

Using LOOP...

code incase anyone's interested:

<?php
$loop=0;
do
{
$loop++;
$looptwo = $loop;
$answerloop = "answer" . $looptwo;
@$answernum = Trim(stripslashes(strtolower($_POST[$answerloop])));
$correctloop = "correct" . $looptwo;
@$correctnum = Trim(stripslashes(strtolower($_POST[$correctloop])));

if ($answernum == $correctnum)
{
$score = $score + 1; }


}
while ($loop<$quantity);
?>