The answer to your IT questions
 

Advanced search  • Search tips
My QUESTIONS & ANSWERS
 Question:

question in php......

User Asked by: karthimessenger
Published on: 09:36/08.04.2008
Status: OPEN
<input type="radio" name="q2" value="1" />
here get the value usung by $v=$_POST['q2'];


The Below a value set by the my database..... in html form.
<input type="radio" name="<?php echo $row['qid'];?>" value="<?php echo $row['ans1'];?>" />

here how i get the radio value in php?
 Answers: 1
Sort by: /\ date | rating
Image Answer by: xpert
Posted on: 09:36/08.04.2008
Rating: 1 from possible 5 with 4 votes
You have to know which radio will be selected by holding answer in some variable, for exmaple $givenanswer. Well if $givenanswer is empty - no problem, nothing will be selected


<input type="radio" name="<?php echo $row['qid'];?>" value="<?php echo $row['ans1'];?>"  <?php if ($givenanswer==$row['ans1']){ echo 'checked="checked" ';}?> />

Vote:

Please vote! Your opinion matters!
If you haven't found what you've looking for, post a question
  
| Home | Hall of fame | Register | Log in | Terms of service | Help | Contacts |