Recommended: Web Video Player Program Code General Code When making a program for the customer, I suddenly encountered a problem, that is, when the user of the product page submitted a video playback file, how to play the correct video format according to the submitted URL... I was depressed for a while, and thought about the idea, and then I started to do it... The idea is to get the file type first,
First, use Access to create a new database , set the name to luntan, the name of the data table to information, create the following fields: text, name, time, and set the default value of time to Now
| The following is the quoted content: <% 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 no comment else rs.MoveFirst while Not rs.EOF. response.write rs(name)&Published on&rs(time)&<br> response.write rs(text)&<br><hr> rs.MoveNext wend AbsolutePosition=N,(N=1,2,3......) end if %> Next is the user's message writing section. Suppose the forum page is information.asp, then <form method=post action=information.asp> Name: <input type=text size=12 name=name><br> Leave a message: <textarea cols=30 row=4 name=text></textarea><br> <input type=submit value=submit> </form> |
The last part is to record the form data submitted by the user into the database,
The following is the quoted content: <% if request(text)<>empty and request (name)<>empty then Set comb=Server.CreateObject(ADODB.Connection) cob.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 %> |
Share: Two interesting visitor counter designs As an indispensable part of the website, the visitor counter can not only record the number of times the website is visited, but also enhance the fun and viewability of the web page through vivid and interesting design, making the visitor counter a landscape on the web page. The following are two easy design fun