Forum Moderators: coopster
echo "<form id=\"form2\" name=\"form2\" method=\"post\" action=\"lin_solv_qz.php\">
<p>
<label>......
......
....
</form>"
Can you call itself back to the same file by using the same file name or should you do it like this:
action=\"print $_SERVER['PHP_SELF']\">
well thats not the main problem. After I POST I want to be able to retrieve the answer and store it in an array which I try by:
//check everything works
$array_number = $_SESSION['qnumber'];
$thisanswer = $_REQUEST['radio2'];
echo "the array number is $array_number and the answer is $thisanswer <p></p>";
//store and display array
array_push($user_ans1, $thisanswer);
foreach ($user_ans1 as $abcde) {
print "$abcde <br/>";
}
The first half displays but the second half doesn't. Any ideas?
Thanks
I am not sure what you are trying to achieve at this stage. I can't see what $user_ans1 is, and the function seems to be used wrongly, i give you an example of array_push:
$a=array("Apple","Orange");
array_push($a,"Akat","Beles");
print_r($a);
:) go figure what Akat and Beles are.
>> action=\"print $_SERVER['PHP_SELF']\">
This part needs to be done differently. you need to take out the print as the line is already embeded in PHP.
Habtom