954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

HTML form with radio button not submitting

');
print('');
print('');
print('Quiz');
print(' ');

?>

<?

print(''.$qid.')'.'   '.$question.'');

?>

   <?php echo $answer1; ?>   <?php echo $answer2; ?>   <?php echo $answer3; ?>   <?php echo $answer4; ?>                           

<?

print('


You cannot go back and resubmit an answer.'.' '.'System counts every submit and it affects your score


');

print('');
print('

rajesh1158
Light Poster
41 posts since Oct 2010
Reputation Points: 10
Solved Threads: 1
 

one breakthrough in the above code. The form is submitting if the form method=GET and i get the required output. But the form is not submitting if the form method=POST

rajesh1158
Light Poster
41 posts since Oct 2010
Reputation Points: 10
Solved Threads: 1
 

change all {name="answer"} to {name="answer[]"} and try

safrasmr
Newbie Poster
2 posts since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

one more thing- convert all <? (short tags) to <?php

safrasmr
Newbie Poster
2 posts since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

nope...that does not work.

rajesh1158
Light Poster
41 posts since Oct 2010
Reputation Points: 10
Solved Threads: 1
 

first thing first, you can embed php in html,

$result=mysql_query($sql);
$row = mysql_fetch_row($result);
$qid=$row[0];
$question=$row[1];
$answer1=$row[2];
$answer2=$row[3];
$answer3=$row[4];
$answer4=$row[5];
$rtanswer=$row[6];

?>


close, the php tags there only, and let html be displayed as html..


,

second thing, you are using mysqli in your database, either use pdo, for database fetch..

try that..

Zahinize
Newbie Poster
9 posts since Nov 2011
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: