how to send value to the from action page from database

Posted by Mayank swami on Stack Overflow See other posts from Stack Overflow or by Mayank swami
Published on 2012-06-13T04:07:45Z Indexed on 2012/06/13 4:40 UTC
Read the original article Hit count: 233

Filed under:
|

I am creating a faq panel for there can be multiple answers for question and i want to take the answer id .because i am storing comment by answer id

the problem is that how to sent the $answer_id to the comment_submit_process.php and how to recognize the answer ?

$selected_ques= mysql_prep($_GET['ques']);
   $query = "SELECT * FROM formanswer where question_id = {$selected_ques}";
    $ans=  mysql_query($query);
    if($ans){
       while($answer = mysql_fetch_array($ans))  

           //here is the form  
        <form id="add-comment" action="comment_submit_process.php" >
         <textarea   class="comment-submit-textarea" cols="78" name="comment" style="height: 64px;"></textarea>
         <input type="submit" name="submitbutton" value="Add Comment" class="comment-submit-button"  >

         <br> <?php
         $ans_id= $answer['id']; 
         echo $ans_id;
         ?>

            <input type="hidden" name="ques" value="<?php echo $_GET['$ans_id'] ?>" />
         <span class="counter ">enter at least 15 characters</span>
         <span class="form-error"></span>
     </form>

<?php }} ?>

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql