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 用ADS设计一款的射频功率放大器
  • ¥15 怎么求交点连线的理论解?
  • ¥20 软件开发方法学习来了
  • ¥15 微信小程序商城如何实现多商户收款 平台分润抽成
  • ¥15 HC32L176调试了一个通过TIMER5+DMA驱动WS2812B
  • ¥15 cocos的js代码调用wx.createUseInfoButton问题!
  • ¥15 关于自相关函数法和周期图法实现对随机信号的功率谱估计的matlab程序运行的问题,请各位专家解答!
  • ¥15 Python程序,深度学习,有偿私
  • ¥15 扫描枪扫条形码出现问题
  • ¥35 poi合并多个word成一个新word,原word中横版没了.