codice:
current_page=Request.QueryString("page")
if current_page="" then current_page=1
num_persone=2
sesso=Request("sesso")
set RS = Server.CreateObject("ADODB.Recordset")
RS.ActiveConnection = MM_marcos_STRING
RS.source = "SELECT Incontri.LastAccess, Incontri.ID, Incontri.Data, Incontri.Nome, Incontri.Username, Incontri.DataNas, Incontri.Sesso, Incontri.Viaggiare, Incontri.UsaFoto, REGIONI.REGIONE AS regione_str FROM REGIONI INNER JOIN (PROVINCE INNER JOIN (ITALIA INNER JOIN (ESTERI INNER JOIN Incontri ON ESTERI.ID=Incontri.Nazione) ON ITALIA.ID=Incontri.Citta) ON PROVINCE.ID=Incontri.Provincia) ON REGIONI.ID=Incontri.Regione WHERE Incontri.Sesso='"&sesso&"' ORDER BY Incontri.LastAccess DESC"
Rs.PageSize=num_persone
RS.CursorType = 1
RS.CursorLocation = 3
RS.LockType = 3
RS.Open()
if RS.EOF = False then
tot_page=RS.PageCount
RS.AbsolutePage = current_page
end if
set RS3 = Server.CreateObject("ADODB.Recordset")
RS3.ActiveConnection = MM_marcos_STRING
RS3.Source = "SELECT * FROM ElencoFoto"
RS3.CursorType = 1
RS3.CursorLocation = 3
RS3.LockType = 3
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style type="text/css" media="screen">
@import url("/css/scroll.css");
</style>
<title>Incontriamoci</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" media="screen">
@import url("/css/scroll.css");
.Stile1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
.Stile2 {
font-family: Georgia, "Times New Roman", Times, serif;
color: #9900FF;
font-size: 9px;
}
a:link {
color: #9900FF;
text-decoration: none;
}
a:visited {
color: #000000;
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
</style>
</head>
<body>
<tr>
<td bgcolor="#CC33FF" align="center">
</p>
<table width="100%" border="0" cellspacing="5">
<tr>
<td bgcolor="#000099"><p style="text-align:right;color:#ffffff;font-weight:bold;font-family:Verdana;font-size:9px;margin:2px;">Pagina
<%=current_page%> di <%=tot_page%></p></td>
</tr>
</table>
<table width="20%" border="0" cellpadding="3" cellspacing="1" bgcolor="#CC99FF">
<%
if RS.EOF = False then
for count=1 to RS.PageSize
if RS.EOF = False then
%>
<tr bgcolor="#E6CCFF">
<td width="1%" bgcolor="#E6CCFF"><div align="left">
<font size="1" face="Verdana, Arial, Helvetica, sans-serif">ID: <%=(RS.Fields.Item("ID").Value)%></font><font size="1" face="Verdana, Arial, Helvetica, sans-serif"></font></p>
</div> </td>
<td rowspan="5" bgcolor="#E6CCFF"><div align="center" class="Stile1"></div>
<div align="center"></div> <div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> </font></div> <div align="center"></div>
<div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> </font></div> <div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<% if RS.Fields.Item("UsaFoto").Value=False then
Response.Write "No"
else
RS3.Open()
do until rs3.eof
if rs3.fields.item("idutente").value = rs.fields.item("ID").value then
if rs3("anteprima") = true then
response.write(RS3.Fields.Item("descr").Value)
else
response.write("Niente anteprima")
end if
end if
rs3.movenext
loop
Rs3.close
end if %>
</font></div>
<div align="center"></div></td>
</tr>
<tr bgcolor="#E6CCFF">
<td bgcolor="#E6CCFF"><font size="1"><font face="Verdana, Arial, Helvetica, sans-serif">UserName </font></font><span class="Stile1"><%=(RS.Fields.Item("username").Value)%></span></td>
</tr>
<tr bgcolor="#E6CCFF">
<td bgcolor="#E6CCFF"><font size="1"><font size="1"><font face="Verdana, Arial, Helvetica, sans-serif">Età</font></font></font><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> <%=(RS.Fields.Item("DataNas").Value)%></font></td>
</tr>
<tr bgcolor="#E6CCFF">
<td bgcolor="#E6CCFF"><font size="1"><font size="1"><font face="Verdana, Arial, Helvetica, sans-serif">Regione </font></font><font size="1"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><%=(RS.Fields.Item("regione_str").Value)%></font></font></font></td>
</tr>
<tr bgcolor="#E6CCFF">
<td bgcolor="#E6CCFF"><div align="right"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">">»»</font></div></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<%
RS.MoveNext()
else
Exit For
end if
Next
end if
%>
</table>
<table width="100%" height="30" border="0">
<tr>
<td valign="bottom" nowrap>
<span class="Stile2">
<%
Dim url,query_array
query_array=Split(Request.QueryString,"&")
url="Incontriamoci.asp?"
for var=1 to UBound(query_array)-1
current_var=Split(query_array(var),"=")
if current_var(0) <> "page" then
url=url¤t_var(0)&"="¤t_var(1)
if var<>(UBound(query_array)-1) then url=url&"&"
end if
next
%>
<%=paginazione(url,tot_page,current_page)%> </span></td>
</tr>
</table></td>
</tr>
<%
set Rs3=Nothing
Rs.close
set Rs=Nothing
Per ogni record del primo recordset, se "usaFoto" è falso scrivi "no",