推薦:網頁視頻播放器程序代碼通用代碼在給客戶做個程序時,突然遇到個問題,就是產品頁用戶提交視頻播放文件時,如何根據提交的網址內的視頻格式進行正確的播放呢....鬱悶了一會,想好了思路,說動手就動手...思路是先取得文件的類型,
首先用Access新建一個數據庫,設取名為luntan,數據表的名稱為information,建立如下字段:text,name,time,並將time默認值設為Now
| 以下為引用的內容: <% Set com = Server.CreateObject(ADODB.Connection) com.openDRIVER={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.OpenDRIVER={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 %> |
分享:趣味訪客計數器設計兩則訪客計數器作為網站不可缺少的部分,不僅可以記錄網站被訪問的次數,而且可以通過生動有趣的設計來加強網頁的趣味性和可觀賞性,使訪客計數器成為網頁上的一個風景。下面介紹兩種輕鬆設計趣