簡單ASP論壇DIY_ASP教程

      編輯Tag賺U幣
      教程Tag:暫無Tag,歡迎添加,賺取U幣!

      推薦:網頁視頻播放器程序代碼通用代碼
      在給客戶做個程序時,突然遇到個問題,就是產品頁用戶提交視頻播放文件時,如何根據提交的網址內的視頻格式進行正確的播放呢....郁悶了一會,想好了思路,說動手就動手... 思路是先取得文件的類型,

      首先用Access新建一個數據庫,設取名為luntan,數據表的名稱為“information”,建立如下字段:“text”,“name”,“time”,并將“time”默認值設為Now

      以下為引用的內容:
      <%

      Set com = Server.CreateObject("ADODB.Connection")

      com.open"DRIVER={Microsoft Access Driver("luntan.mdb");

      pwd=information;DBQ="&Server.MapPath("luntan.mdb")

      sql="select*from information order by time Desc"

      Set rs=Server.CreateObject("ADODB.Recordest")

      rs.open sql,com,3,2

      if rs.EOF or rs.BOF then

      response.write"沒有留言"

      else

      rs.MoveFirst

      while Not rs.EOF.

      response.write rs("name")&"發布于"&rs("time")&"<br>"

      response.write rs("text")&"<br><hr>"

      rs.MoveNext

      wend

      AbsolutePosition=N,(N=1,2,3......)

      end if

      %>

      接著是用戶書寫留言部分。設論壇頁為“information.asp”,則

      <form method=post action="information.asp">

      姓名:<input type=text size=12 name="name"><br>

      留言:<textarea cols=30 row=4 name="text"></textarea><br>

      <input type=submit value="提交">

      </form>

      最后一部分是將用戶提交的表單數據記錄到數據庫中,則

      以下為引用的內容:
      <%
      if request("text")<>empty and request ("name")<>empty then

      Set comb=Server.CreateObject("ADODB.Connection")

      comb.Open"DRIVER={Microsoft Access Driver(*.mdb)};pwd=information;

      DBQ="&Server.MapPath("luntan.mdb")

      sql="select*from information"

      Set rsb=Server.CreateObject("ADODB.Recordset")

      rsb.open sql,comb,3,2

      rsb.AddNew

      rsb("text")=request("text")

      rsb("name")=request("name")

      rsb.update

      end if
      %>

      分享:趣味訪客計數器設計兩則
      訪客計數器作為網站不可缺少的部分,不僅可以記錄網站被訪問的次數,而且可以通過生動有趣的設計來加強網頁的趣味性和可觀賞性,使訪客計數器成為網頁上 的一個風景。下面介紹兩種輕松設計趣

      來源:模板無憂//所屬分類:ASP教程/更新時間:2008-08-22
      相關ASP教程