<% '---------------------------------- 'index.asp 'main page ' ' '---------------------------------- %> <%'variable definitions dim fromindex 'for illegal usages of sub pages (e.g. writemsg.asp; counter.asp e.t.c) dim conn,rs 'for database connection dim uname,umail,uicq,uwww,mthisdate,ip(4),mthistext 'for message properties dim perpage,i,totalmsg,totalpage,curpage,temp,login 'miscellaneous variables if session("loggedin")=true then login=true else login=false ' looking for user admin or not fromindex=true 'key %> <% curpage=Request.QueryString ("curpage") 'getting current page if curpage="" then curpage=1 if isnumeric (curpage)=false then Response.Redirect ("index.asp") %> <% sql="SELECT COUNT (*) FROM data" 'SQL string for counting messages set rs=conn.execute(sql) totalmsg=rs(0) rs.close if totalmsg=0 then 'if there is no messages in guestbook %>
Sign Guestbook  Sign Guestbook Page:  ##   ##  ##   ##   ##  ##   ##  ##   ##  <<prev next>> Admin Login  Admin Login
There is no messages at this time, please use Sign Guestbook link,
<% else sql="SELECT * FROM data ORDER BY CDate(thisdate) DESC" set rs=conn.execute (sql) totalpage=(int((totalmsg/perpage)*-1))*-1 if cint(curpage)>cint(totalpage) then curpage=1 if cint(curpage)=<0 then curpage=1 rs.move ((curpage - 1)*perpage) %> <% for i=1 to perpage if rs.eof or rs.bof then exit for uname=shield(rs("name")) umail=shield(rs("mail")) uicq=rs("icq") uwww=shield(rs("www")) mthisdate=rs("thisdate") ip(1)=rs("ip#1"):ip(2)=rs("ip#2"):ip(3)=rs("ip#3"):ip(4)=rs("ip#4") mthistext=shield(rs("thistext")) %> <% rs.movenext next %> <% EndTable = "" %> <%= EndTable %> <%end if%> <%fromindex=false %>