Control Panel - View/Edit Entries - LogOut  
 
 View/Edit Guestbook entries

<% ' Create a Data Connection to the database. Data connection can be any ODBC database as long as a DSN has been created. set oconn = server.CreateObject("ADODB.connection") oConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../guestbook.mdb") SQLtemp="SELECT * from guests ORDER BY id ASC" ' Set the paging parameters. MyPageSize is the number of records displayed on each page. we are also checking to see if we should use the SQLtemp string, or the URL encoded SQL string. mypage=request("members") If mypage="" then mypage=1 ' If passing a session variable, include that code here. Example: If you are calling this ASP from an HTML form that has a field called mydescription. 'session("mydescription") = Request.QueryString("mydescription") end if mypagesize=request("pagesize") If mypagesize="" then mypagesize=30 end if mySQL=request("SQLquery") IF mySQL="" THEN mySQL=SQLtemp END IF ' Open a recordset and set paging set ors=Server.CreateObject("ADODB.Recordset") ors.cursorlocation=3 ors.cachesize=20 ors.open mySQL,oconn ors.movefirst ors.pagesize=mypagesize maxpages=cint(ors.pagecount) maxrecs=cint(ors.pagesize) ors.absolutepage=mypage howmanyrecs=0 %>

<% do while not ors.eof and howmanyrecs < maxrecs ' Check to see what color the row should be. These colors are light grey, and dark grey. Color names are not recommended here. If iswitch = TRUE then rcolor = "#D9E0F0" iswitch = False Else rcolor = "#f2f2f2" iswitch = TRUE End If %> <% ors.movenext howmanyrecs=howmanyrecs+1 loop %>
<%=oRS("name")%>
<%=oRS("location")%>
<%=oRS("email")%>
<%=oRS("guest_ip")%>
<% Dim checkstat checkstat = ors("active") if checkstat = 1 then Response.write("Verified") ElseIf checkstat = 0 then response.write("On Hold") Elseif checkstat =2 then response.write("Hidden") %> <% End if %>
">
<% pad="0" scriptname=request.servervariables("script_name") %>
[ <%response.write "Page " & mypage & " of " & maxpages & ""%> ] <% for counter=1 to maxpages If counter>=25 then pad="" end if ref="" & pad & counter & "" response.write ref & " " next %> <% ors.close set rstemp=nothing %>
Note:
Edit  Hide Hide
 
© Copyright 2005 Emefa's Educational Site ( Emefa Guestbook V 3.0)