i wanna dispaly qus for the corresponding selected radio button..how to do tht can u help..this code need some modifications but what i dnt knw ,need ur help
<html>
<body>
<form action="userlogged.php" method="POST">
<div style="width: 300px;">
<fieldset>
<legend> select the exam u want to take </legend>
<input type="radio" name="ggroup" value="1" checked="checked"> C<br>
<input type="radio" name="ggroup" value="2"> C++<br>
<input type="radio" name="ggroup" value="3"> VB.Net<br>
<input type="radio" name="ggroup" value="4"> Asp.Net<br>
</fieldset>
</div>
</form>
</body>
</html>
<?php
include ('./userloggingtrue.php');
$connection = pg_connect("dbname=est user=dev host=localhost");
$query = "select * from questions where ggroup=1 order by random() ";
$result = pg_query($connection, $query);
print '<form action="getmarks5.php" method="post">';
$count = 0;
while ($row = pg_fetch_array($result))
{
get questions from database
$count++;
$query ="select * from answers where question= '".$row[0]."' order by random()";
$result = pg_query($connection, $_query);
$question = str_replace("\n","<br>",$row['question']);
$question = str_replace(" " ," ",$question);
$question = str_replace("\t"," ",$question);
print ' <input type="hidden" name="Q'.$row[0].'" value="OK"><strong>'.$count.'.'.' '.$question.'</strong><br>'."\n";
print '<ol style="list-style-type: lower-latin;">'."\n"; #for giving a,b,c,d alphabets to answers;
while ($row = pg_fetch_array($result))
{
print "\t".'<li>'; #li tells the start of the list itmes
if($row['type'] == 0)
{
one answer is correct
print '<input type="radio" name="q'.$row[0].'" value="'.$_row['answer'].'"> ';
}
else
{
more than one answer is correct
print '<input type="checkbox" name="q'.$row[0].''.$row['answer'].'" value="ok"> ';
}
print $_row['text'].'</li>' . "\n";
}
print '</ol><br>'."\n";
}
print '<input type="submit" value="Finish">';//finish button
print '</form>';
?>