<%
if mid1="" then
sql="select id,nam,tim,fnam from photos where bid>=22 order by tim desc"
else
sql="select id,nam,tim,fnam from photos where bid>=22 and mid="&mid1&" order by tim desc"
end if
rs.open sql,conn,1,1
if rs.eof then
%>
<%
else
const ipp=50
rs.pagesize=ipp
page=checkstr(request("page"))
if page="" then
page=1
elseif cint(page)<1 then
page=1
elseif cint(page)>rs.pagecount then
page=rs.pagecount
else
page=cint(page)
end if
rs.absolutepage=page
i=0
while (not rs.eof) and i