<%@ Language=VBScript %> <% maxpagina=20 cnNews.open Set rs = Server.CreateObject("ADODB.Recordset") if Request.QueryString("let") ="" then lista=true sSQL="SELECT * FROM Notizie ORDER BY ID DESC " else lista=false sSQL="SELECT * FROM Notizie Where ID=" + cstr(Request.QueryString("let")) end if if sSQL<>"" then rs.Open sSQL,cnNews,3,1 if rs.RecordCount>0 then rs.MoveFirst else sSQL="" end if if Request.QueryString("pag")="" then pagina=1 else pagina=cint(Request.QueryString("pag")) end if end if %>
<% if lista=true then if rs.RecordCount>0 then %> <% rs.movefirst rs.pagesize=20 maxpages=cint(rs.pagecount) rs.absolutepage=pagina indice=0 do until rs.Eof or indice=maxpagina %> <% response.write("") response.write("") response.write("") %> <% indice=indice+1 rs.movenext loop %>
Data Titolo Segnalato
" + "" + cstr(rs("Data")) + "" + "" + cstr(rs("Titolo")) + "" + "" + cstr(rs("Autore")) + "


Pagina: <% for x= 1 to maxpages if x=pagina then Response.Write(cstr(x) + " ") else Response.Write("" + cstr(x)+ " " + "") end if next %>
<% end if %> <% else %>
segnalata da <% Response.Write(cstr(rs("autore"))) %>
<% Response.Write(formatstr(cstr(rs("titolo")))) %>
<% Response.Write(formatstr(cstr(rs("notizia")))) %>


Fonte:<% Response.Write(formatstr(cstr(rs("fonte")))) %>
<% end if rs.Close set rs=nothing cnnews.close set cnNews=nothing %>