<%@ Language=VBScript %> THOANGSAIGON: SO LUU NIEM
Giới thiệu  |  Tin tức  |  CLB Người Sài gòn |   Diễn đàn  |  Liên lạc  |  Sổ lưu niệm
< In trang  > 
Sổ Lưu Niệm
www.thoangsaigon.com

MỜI BẠN ĐIỀN VÀO SỔ LƯU NIỆM

Họ và tên:
Email:
Nội dung:
<% strConnect = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &Server.MapPath("guestbook.mdb") Set objConn = Server.CreateObject("ADODB.Connection") objConn.open strConnect Set objRS = Server.CreateObject("ADODB.RecordSet") Set maxid = Server.CreateObject("ADODB.RecordSet") maxid.open "select max(id) from guestbook",objConn,2,2 objRS.open "select * from guestbook",objConn,2,2 dim m if objRS.BOF and objRS.EOF then m = 1 else m = maxid(0) + 1 end if 'Response.Write m dim a, b, c, d a = Request.Form("name") b = Request.Form("email") c = Request.Form("comments") d = now() 'Response.Write d if len(a) > 1 and len(b) > 1 and len(c) > 1 then objRS.AddNew objrs("name") = a objrs("email") = b objrs("comments") = c objrs("date") = d objrs("id") = m objRS.Update end if if objrs.BOF and objrs.EOF then Response.Write "
Sorry, Currently There is No Records in the Database
" %>


<% else objrs.MoveLast Do While NOT objrs.bof %>
Name:<% Response.Write objrs("name") %>
Email:><%Response.Write objrs("email")%>
Comments:<%Response.Write objrs("comments")%>
<%Response.Write objrs("date")%> (GMT Time)



<% objrs.MovePrevious loop end if %>