Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question: $qcount=1; while($row=mysql_fetch_assoc($fetch1)) { ?> <tr> <td><?php

ID: 3551794 • Letter: Q

Question

Question:


$qcount=1;


while($row=mysql_fetch_assoc($fetch1))

{

?>


<tr>

<td><?php echo $row['sub_title']."<br>";?></td>

<td><input type="radio" name="<?php echo $qcount;?>" value="1"/></td>

<td><input type="radio" name="<?php echo $qcount;?>" value="2"/></td>

<td><input type="radio" name="<?php echo $qcount;?>" value="3"/></td>

<td><input type="radio" name="<?php echo $qcount;?>" value="4"/></td>

<td><input type="radio" name="<?php echo $qcount;?>" value="5"/></td>

</tr>

<?php

$qcount+=1;

}


if(isset($_post['btnsubmit']))

{

for($i=0; $i<$qcount; $i++)

{

$result[i]=$_post[$qcount]; //error

$i+=1;

echo $result[i];

}

}


?>


how to get post to $result ??

Explanation / Answer

/* instead of using "$_post" you have to use '$_POST' all in capital letters. */



$qcount=1;


while($row=mysql_fetch_assoc($fetch1))

{

?>


<tr>

<td><?php echo $row['sub_title']."<br>";?></td>

<td><input type="radio" name="<?php echo $qcount;?>" value="1"/></td>

<td><input type="radio" name="<?php echo $qcount;?>" value="2"/></td>

<td><input type="radio" name="<?php echo $qcount;?>" value="3"/></td>

<td><input type="radio" name="<?php echo $qcount;?>" value="4"/></td>

<td><input type="radio" name="<?php echo $qcount;?>" value="5"/></td>

</tr>

<?php

$qcount+=1;

}


if(isset($_POST['btnsubmit']))

{

for($i=0; $i<$qcount; $i++)

{

$result[i]=$_POST[$i]; //qcount changed to $i

$i+=1;

echo $result[i];

}

}


?>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote