dongweng9474 2013-04-02 07:15
浏览 118
已采纳

分页并存储到数据库中

Hi all I want to create question and answer with pagination, after clicking the next button first page should validate and store in database and will go to next page? i tried some code but i have no idea how to post the value and store into database with pagination.

my code is

<form class="cmxform" id="form1" method="get" action="process.php" >
$newsquestion=$db->paging("SELECT * FROM question where classname='$_SESSION[class_name]' and category in (select category from cat where class_name='$_SESSION[class_name]' order by p_order) and  status='1'",1);
foreach($newquestion as question)
{
$answer=$db->get_results("SELECT * FROM answer where qid='$question->id'");
foreach($newanswer as $answer)
         {
<input type="radio" name='answer_value1[<?php echo $question->id?>]' value="<?php echo$answer->id?>" validate="required:true" />

}
Comment :<textarea  rows="5" cols="50" name="comment[<?php echo $question->id?>]" validate="required:true'" ></textarea>

}

and in pagination field i put

$linktext.=" <a href='$nextlnk' title='Show Next ".$this->MaxRecord." Data'><input type='Submit' name='button' value='Submit' ></a>";

How can i store the question value in database.

please help

  • 写回答

1条回答 默认 最新

  • doutenggu4070 2013-04-02 07:18
    关注

    If you use PHP you can add the following after having updated your mysql database to redirect the user to the next page:

    header("Location: $nextlnk");
    

    Then all you need is a submit button that says "Next" that will both post the answer and push the user forward to the next question.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探