$_POST not working.it aint producing any values
<pre><code>&lt;?php
$query = "Select * from users where username = '$user' ";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result);

$test = $_POST['test1'];
$ques = "Select * from questions where testname = '$test' ";
$qres = mysql_query($ques) or die(mysql_error());
$qdetails = mysql_fetch_array($qres);
$id = $qdetails['id'];
$testname = $qdetails['testname'];
$ans = "Select * from answers where qid = $id";
$ares = mysql_query($ans) or die(mysql_error());
if($qdetails) {
?&gt;
&lt;div class="padding"&gt;

 &lt;form name="answerform" action="answer.php" method="GET"&gt;
&lt;h3&gt;&amp;nbsp;&lt;/h3&gt;
&lt;input name="test2" id="test2"  type="text" value="&lt;?php echo $qdetails['testname'];?&gt;" /&gt;&lt;h3&gt;&lt;?php echo $qdetails['text'];?&gt;&lt;/h3&gt;
 &lt;input name="test3" id="test3"  type="text" value="&lt;?php echo $qdetails['testseries'];?&gt;" /&gt;&lt;h3&gt;&lt;?php echo $qdetails['text'];?&gt;&lt;/h3&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;?php while($opdetails = mysql_fetch_assoc($ares)) { ?&gt;
&lt;input class="text" id="opt2" name="correctans" type="radio" value="&lt;?php echo $opdetails['text']; ?&gt;" /&gt;&lt;br /&gt;&lt;?php echo $opdetails['text']; ?&gt;  &lt;?php }?&gt;
&lt;div class="two-fields clearfix".
&lt;p class="confirm"&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;input type="submit" value="SUBMIT ANSWER" /&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>

<p>this is the code for the program where i am creating the fields i want to fetch the data from the input fields with the name test 2 and test 3 in answer.php</p>

<pre><code>$query = "Select score from users where username = '$user' ";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result);
$user_score = $row['score'];

print_r($_REQUEST);
$tester = $_GET['test3'];
$test = $_GET['test2'];
print_r($_GET);
var_dump($_GET);
$ques = "Select * from questions where testname = '$test' And testseries = '$tester' ";
$result = mysql_query($ques) or die(mysql_error());
$row = mysql_fetch_array($result);
$qid = $row['id'];
$score = $row['score'];
if(isset($_POST['correctans']))
{
$answer = $_POST['correctans'];
}
else
{
$answer = '';
}
$fetch_ans = "Select * from answers where correct = 1 AND qid = $qid";
$result = mysql_query($fetch_ans) or die(mysql_error());
$row = mysql_fetch_array($result);
$id = $row['id'];
$correctans = $row['text'];

if('$correctans' == '$answer')
{
$user_score += $score;
$qid++;
$query = "Update users set score = $user_score  where username = '$user'";
$res = mysql_query($query) or die(mysql_error());
if($res) {

header("Location: answer.php");  
}
}else
{ 
header("Location: answer.php"); 
}


?&gt;
</code></pre>

<p>THIS IS answer.php and here i try to post information from test2 and test3 fields  but i am not getting any output
the output shows blank array()
and unidentified index test2
and unidentified index test3
i am not able to figure out the error
any help will be highly appreciated
and forgive me if i have made any mistakes in posting the question since i am a newbie at stackoverflow</p>
