码迷,mamicode.com
首页 > 其他好文 > 详细

回复提问模块设计

时间:2015-06-29 06:18:35      阅读:85      评论:0      收藏:0      [点我收藏+]

标签:

回复提问模块功能的实现

1.先在热门关注上选择一个问题或者市搜索关键字选择一个问题

技术分享

2.再点击主题栏里的关键字进入这个问题

技术分享

代码:

 <body>
     <div id="bg" style="position:absolute; width:100%; height:100%; z-index:-1"> 
        <img src="img/MainLog.png" height="100%" width="100%" >
     </div>
   <div>
     <table align="center" width="100%" border="2">
        <tr background="#44ccff">
            <th>编号</th>
            <th>评论者</th>          
            <th>内容</th>       
        </tr>
        <%
          String topic=new String(request.getParameter("topic").getBytes("ISO-8859-1"),"UTF-8");
          String author=new String(request.getParameter("author").getBytes("ISO-8859-1"),"UTF-8");      
          Connection con=null;
          Statement stmt=null;
          ResultSet rs=null;
          int i=-1;
          Class.forName("com.mysql.jdbc.Driver");
          String url="jdbc:mysql://localhost:3306/learning?useUnicode=true&characterEncoding=gbk";
          con=DriverManager.getConnection(url,"root","root");
          stmt=con.createStatement();
          String query="select distinct * from `review` where author=‘"+author+"‘ and topic=‘"+topic+"‘ ";
          rs=stmt.executeQuery(query);
          while(rs.next()){ 
          i++; 
          if(i==0){continue;}    
           %>
          <tr>
              <td align="center"><%=i %></td>
              <td><%=rs.getString("revi") %></td>
              <td><%=rs.getString("revcontent") %></td> 
          </tr>
          <%
          }
           %>
     </table>
     </div>
     <br><br><br><br><br><br><br><br><br><br><br>
     <div id="mq" >
     <hr style="FILTER: alpha(opacity=100,finishopacity=5,style=5)" width="95%" color=#987cb9 size=20 > 
  <form action="dealing/review.jsp" method="get">
         
                   评    论   者:<input type="text" name="revi" size="20">           
                    <p id="matter" align="left">   内   容:</p>  <textarea id="matterright" name="revcontent" rows="8" cols="70" >
                                     </textarea><br>
             <input type="hidden" name="author" value="<%=author %>"/>
             <input type="hidden" name="topic" value="<%=topic %>"/>
             <p id="mqp">
               <input type="submit" value="提交" >  <input type="reset" value="重置">  <a href="http://localhost:8080/Management/dealing/hotquestion.jsp">返回</a> 
             </p>

        </form>
      </div>
  </body>

  3.回复问题成功后,点击我的问题将显示回复

技术分享

  <body>
       <div id="bg" style="position:absolute; width:100%; height:100%; z-index:-1"> 
        <img src="img/tools25.gif" height="100%" width="100%" >
     </div>
<div id="mq" >
  <form action="dealing/makeQuestion.jsp" method="post">
         <br>
                      问题类型:<%=request.getSession().getAttribute("classify") %><br><br>
                    留   言   者:<%=request.getSession().getAttribute("author") %><br><br>
                          留言标题:<%=request.getSession().getAttribute("topic") %>
                    <p id="matter" align="left">   内   容:</p>  
                  <textarea id="matterright" name="mainbaby" rows="8" cols="70" >
                  <%=request.getSession().getAttribute("mainbaby") %> </textarea><br>
             
             <p id="mqp">
               <input type="submit" value="返回" >
</p>
        </form>
      </div>
  </body>

  

 

回复提问模块设计

标签:

原文地址:http://www.cnblogs.com/fellerlong/p/4606435.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!