亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 編程 > ASP > 正文

postmessage.aspx 上貼保存

2024-05-04 11:06:25
字體:
來源:轉載
供稿:網友
3) postmessage.aspx :- the page which saved data to the database


<%@ import namespace="system" %>
<%@ assembly name="system.data" %>
<%@ import namespace="system.data" %>
<%@ import namespace="system.data.ado" %>
<%@ page language="c#" debug="true" %>
<html>
<head>
<title>thank you for posting !</title>
<script language="c#" runat="server" >
  //execute this script when the page loads
  void page_load(object src, eventargs e)
  {
     //if the page is called from another page
     if (!page.ispostback) {
       //get all the parameters from the query string
       string name = request.params["name"] ;
       string email = request.params["email"] ;
       string subject = request.params["subject"] ;
       string ip = request.params["ip"] ;
       string date = request.params["date" ];
       string message = request.params["message"] ;
       bool newmess =true ;
       string previd ="1";
       //check if the post is a new topic or a reply to a new topic
       if(request.params["newpost"].equals("no"))
       {
          //if its a reply then get the postid called as previd here
          newmess =false ;
          previd = request.params["previd"] ;
       }
       //if the post is a new topic then follow the below routine
       if(newmess)
       {
          //the string for the path to the database , if your database is in some other
directory then edit the path
          //of this variable  
          string [email protected]"provider=microsoft.jet.oledb.4.0 ;data source=
"+server.mappath(".//db//board.mdb") ;
          //get a adoconnection to the database
          adoconnection myconn = new adoconnection(strconn) ;
          //the sql select statement
          string strcom = "select postid from newpost" ;
          //create a adocommand since we want a adodatareader later
          adocommand mycommand =new adocommand(strcom,myconn);
          //open the connection
          myconn.open();
          adodatareader reader;
          //execute the command and get the data into "reader"
          mycommand.execute(out reader) ;
          int i=1 ;
          //get the current number of records present in the database.
          while(reader.read())
          {
              i++ ;
          }
          reader.close() ;
         //build the sql statement to insert into the database
          string insertstr =" insert into newpost values ("
+i +", '"
+name+"', '"
+email+"', '"
                +subject+"', '"
+ip+"', '"
+date+"', '"
+message+"',0, 0)" ;
          mycommand.commandtext =insertstr ;
          //since the sql statement does not return any output use "executenonquery() method
          mycommand.executenonquery() ;
         //close the connection
          myconn.close() ;
        }
        else
        {
           //if the posted data is a reply to a topic then follow the below procedure
           //string for the path to the database, if your database is stored in some other directory then
           //edit the path here   
           string [email protected]"provider=microsoft.jet.oledb.4.0 ;data source="+
server.mappath(".//db//board.mdb") ;
           adoconnection myconn = new adoconnection(strconn) ;
           //sql statement to select the replyid
           string strcom = "select replyid from reply" ;
           //create a adocommand
           adocommand mycommand =new adocommand(strcom,myconn);
           //open the connection
           myconn.open();
           adodatareader reader;
           //execute the command and get the data into "reader"
          mycommand.execute(out reader) ;
          int i=1 ;
          //get the current number of records present in the database.
          while(reader.read())
          {
              i++ ;
          }
          reader.close() ;
          //build a statement to insert the values into the reply table
          string insertstr =" insert into reply values ("
+i +", '"
+name+"', '"
+email+"', '"
+subject+"', '"
+ip+"', '"
+date+"', '"
+message+"', "
+previd+")";
          mycommand.commandtext =insertstr ;
          //executenonquery - since the command does not return anything
          mycommand.executenonquery() ;
         //string to get the replies column from the newpost table
          string replyno = "select replies from newpost where postid ="+previd ;
          mycommand.commandtext =replyno ;
          //execute command and get the reader
          mycommand.execute(out reader) ;
          //read the first record (remember there can only be one record in the reader since postid is unique)
          reader.read();
          //get the "int16" value of the number of replies from the replies column in the newpost table
          int rep =reader.getint16(0) ;
          reader.close() ;
          rep++ ;
          //sql statement to update the replies field in the newpost table
          string updtstr ="update newpost set replies = "+rep
+" where (postid = "+previd+")" ;
          mycommand.commandtext = updtstr;
         //executenonquerry why ?? i guess u should know by now !
          mycommand.executenonquery();
          myconn.close() ;
       }
       //get the different parameters from the query string and store it
       //to respective labels
       namelabel.text = name;
       emaillabel.text= email ;
       subjectlabel.text=subject;     
       messagelabel.text=message ;    
    }
   else
    {
       //else display an error
       errmess.text="this page cannot be called directly. it has to be called from the form posting page.<br>" ;
     }
  }
</script>
<link href="mystyle.css" type=text/css rel=stylesheet>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0">
<!-- #include file="header.inc" -->
<center>
<asp:label id="errmess" text="" style="color:#ff0000" runat="server" />
<h2 class="fodark"><b>thank you , for posting on the message board.</b></h2>
<table align=center width="60%" border="0" cellspacing="2" cellpadding="1" >
<tr class="fohead"><td colspan="2">the information you posted!</td></tr>
<tr class="folight">
<td>name :</td>
<td><asp:label id="namelabel" text="" runat="server" /></td>
</tr>
<tr class="folight">
<td>e-mail :</td>
<td><asp:label id="emaillabel" text="" runat="server" /></td>
</tr>
<tr class="folight">
<td>subject :</td>
<td><asp:label id="subjectlabel" text="" runat="server" /></td>
</tr>
<tr class="folight">
<td>message :</td>
<td><asp:label id="messagelabel" text="" runat="server" /></td>
</tr>
</table>
<br>
<h4 class="fodark"><a href="forum.aspx">click here </a> to go back to the forum.<br>
<%-- a little work to show the link to return back to the page if, the post was a reply --%>
<% if(request.params["previd"]!=null)
     { %>
      <a href='reply.aspx?postid=<%=request.params["previd"] %>'> click here </a>to go back
where you came from.
<% } %>
</h4>
</center>
<!-- #include file="footer.inc" -->
</body>
</html>
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
久久久久国产精品www| 日韩不卡中文字幕| 韩国视频理论视频久久| 欧美激情国内偷拍| 国产精品日韩一区| 一本色道久久88亚洲综合88| 日韩av手机在线看| 日韩电影网在线| 久久久之久亚州精品露出| 亚洲国模精品私拍| 国产精品高潮呻吟久久av黑人| 亚洲欧美成人精品| 亚洲黄页视频免费观看| 伊人久久久久久久久久久| 欧美激情视频三区| 国产精品丝袜久久久久久高清| 国产91成人在在线播放| 中文字幕久久久av一区| 2019中文字幕免费视频| 国语自产精品视频在线看| 欧美一区二区三区免费视| 国产精品扒开腿做爽爽爽男男| 久久精品91久久久久久再现| 日韩在线激情视频| 久久久久久中文| 亚洲一区美女视频在线观看免费| 欧美激情视频在线免费观看 欧美视频免费一| 日韩免费不卡av| 国产精品偷伦一区二区| 在线视频欧美性高潮| 日本一区二区三区在线播放| 久99久在线视频| 91精品国产网站| 欧美做爰性生交视频| 欧美日韩国产成人在线| 国产精品美乳在线观看| 亚洲最大福利视频网站| 不卡av在线网站| 久久久久久久国产精品| 国产精品国产亚洲伊人久久| 精品调教chinesegay| 亚洲国产精品专区久久| 亚洲综合小说区| 久久人人爽人人爽人人片av高清| 深夜福利国产精品| 最新69国产成人精品视频免费| 成人激情免费在线| 丝袜美腿精品国产二区| 亚洲视频999| 亚洲va欧美va国产综合久久| 欧美黑人xxxⅹ高潮交| 中文在线资源观看视频网站免费不卡| 一区二区三区国产在线观看| 国产亚洲一区二区精品| 蜜臀久久99精品久久久无需会员| 欧美极品少妇xxxxⅹ喷水| 日韩欧美中文字幕在线观看| 久久国产天堂福利天堂| 亚洲午夜av电影| 国产精品视频在线观看| 久热在线中文字幕色999舞| 久久成人精品电影| 欧美最猛性xxxxx(亚洲精品)| 亚洲影院污污.| 欧美洲成人男女午夜视频| 欧美大片在线看免费观看| 国产精品久久久久久久久久新婚| 欧美日韩国产中文字幕| 国产精品久久久久久久久影视| 亚洲天堂免费观看| 精品高清美女精品国产区| 色青青草原桃花久久综合| 亚洲无亚洲人成网站77777| 国产精品极品美女粉嫩高清在线| 欧美高清视频在线播放| 欧美大片免费观看在线观看网站推荐| 国产一区深夜福利| 午夜精品久久久久久久久久久久| 亚洲欧美激情四射在线日| 国产欧美精品在线播放| 国产69久久精品成人看| 久久精品亚洲94久久精品| 亚洲欧洲国产伦综合| 欧美日韩国产精品专区| 91亚洲午夜在线| 91免费看片网站| 欧美综合在线第二页| 亚洲精品日韩欧美| 91超碰caoporn97人人| 狠狠操狠狠色综合网| 久久亚洲精品网站| 亚洲国产成人精品久久久国产成人一区| 欧美小视频在线观看| 欧美另类第一页| 91美女片黄在线观| 欧美性猛交xxxx偷拍洗澡| 青青a在线精品免费观看| www.亚洲成人| 成人综合国产精品| 日韩亚洲欧美成人| 成人av番号网| 亚洲人成电影网站色| 欧美日韩国产精品一区二区三区四区| 国产不卡精品视男人的天堂| 欧美性感美女h网站在线观看免费| 午夜精品久久久久久久久久久久| 久久精品国产2020观看福利| 日韩精品免费在线视频观看| 国产不卡av在线| 精品日韩视频在线观看| 色综合视频一区中文字幕| 日韩免费中文字幕| 中文字幕亚洲图片| 欧美高跟鞋交xxxxhd| 欧洲亚洲在线视频| 精品中文字幕在线2019| 日韩欧美在线观看| 成人午夜高潮视频| 日本欧美在线视频| 在线性视频日韩欧美| 欧美激情18p| 91亚洲va在线va天堂va国| 91国产一区在线| 亚洲天堂免费视频| 78m国产成人精品视频| 国产日韩欧美在线播放| 国产美女精品免费电影| 色婷婷久久av| 亚洲欧洲在线播放| 亚洲v日韩v综合v精品v| 久久精品国产v日韩v亚洲| 亚洲精品720p| 日韩av电影在线播放| 影音先锋欧美在线资源| 国产日韩在线精品av| 久久成人一区二区| 亚洲aⅴ日韩av电影在线观看| 国产91精品视频在线观看| 国产精品福利在线观看| 欧美午夜女人视频在线| 欧美性生交大片免网| 亚洲精品久久久久国产| 欧美一级大胆视频| 永久免费毛片在线播放不卡| 欧美亚洲国产日韩2020| 国语自产精品视频在线看一大j8| 26uuu另类亚洲欧美日本老年| 欧美专区在线视频| 欧美另类xxx| 久久偷看各类女兵18女厕嘘嘘| 欧美人与性动交| 日韩精品极品毛片系列视频| 尤物精品国产第一福利三区| 福利精品视频在线| 成人黄色av免费在线观看| 久久国产精品影片| 久久影视免费观看| 亚洲色图色老头| 久久久久久久av| 欧美精品videosex性欧美| 欧美日韩亚洲成人| 久久九九精品99国产精品| 国产一区二区在线免费| 国产精品老女人视频|