Mirabilweb
a- a+

Creare un sistema per la gestione delle news (Parte III)

Pagina 3 di 8

Come è possibile notare nel precedente listato dicodice asp, si inserisce per ogni news un link del tipovisualizza.asp?id=id_news, in tal modonella pagina visualizza.asp, sarà possibilerichiedere l’id della news e visualizzarequest’ultima…

 

Ecco il codice della pagina visualizza.asp:

 

<%‘SI UTILIZZA PER PERMETTERE IL REINDIRIZZAMENTO IN UNA PAGINA:response.buffer = true%><html> <head><title>Creazione Sistema per la gestione delle news</title></head> <body> <p align="center"><font size="2" face="Verdana"><b>Creazione Sistema per lagestione delle news</b></font></p><p align="left"><font size="2" face="Verdana"><b>La news in dettaglio:</b></font></p><p align="left"><font size="2" face="Verdana"><!-- #INCLUDE FILE="db.asp" --><!-- #include file="adovbs.inc" --><%‘SI APRE LA CONNESSIONE AL DB E SI SELEZIONA LA NEWSSet RecSet = Server.CreateObject("ADODB.Recordset")News = "SELECT * FROM news where id = " & Request.QueryString("id") &""RecSet.Open News, Connect, adOpenStatic, adLockOptimistic%> <%‘SE LA NEWS NON ESISTE SI VIENE PORTATI NEL SOMMARIO DELLE NEWSif RecSet.eof thenResponse.Redirect "index.asp"‘ALTRIMENTI SI VISUALIZZA IN DETTAGLIO LA NEWSelse%>    <%=RecSet("Data")%> - <b><%=RecSet("Titolo")%></b> by <b><%=RecSet("autore")%></b></b><br><br> <%=RecSet("news")%>  <%‘ SI CHIUDE LA CONNESSIONE AL DB E SI METTE FINE ALLA PRECEDENTE CONDIZIONE…   RecSet.CloseConnect.CloseEnd IF%> </font><p align="right"><a href="http://www.mirabilweb.tk"><font size="2" face="Verdana"><b>byMirabil Web Computer - Tutto sui PC!</b></font></a></p> </body></html>