23 messaggi dal 25 luglio 2002
Buongiorno,
è possibile creare una pagina di dettaglio ottenuta tramite l'invio di due parametri url invece di uno solo?
grazie

2.907 messaggi dal 15 maggio 2001
Contributi
Certo che sì !

esempio :

http://www.tuosito.it?autore=Paolo&libro=rosso

pagina di ricezione :

<%
autore=Request.QueryString("autore")
libro=Request.QueryString("libro")

'fai una selezione nel database con 2 parametri

rs.Open("Select*from nome_tabella where autore like '%"&autore&"%' And libro Like '%"&libro&"%'"),connessione

if rs.EOF then
Response.write "Non ci sono record corrispondenti"
else
Do while Not rs.EOF
Response.write rs("nome_campo")&"<br>"
rs.MoveNext
Loop
end if
%>





<font size=3> -¦» Rome Webmaster «¦- </font id=size3><font size=2> <b> [</b> Alla prossima<b> ]</b> </font id=size2>

Gabriele Romeo
<b>Community Manager di</b> http://www.aspitalia.com
23 messaggi dal 25 luglio 2002
Se trovi un attimo di tempo, un attimo piuttosto lungo, ti propongo il codice finora scritto.
cosa non va?
se è un caso disperato, lascia pure perdere.
grazie comunque
ciao

&lt;%@LANGUAGE="VBSCRIPT"%&gt;
&lt;!--#include file="Connections/caldaie.asp" --&gt;
&lt;%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
if (request.querystring("TXTComune") &lt;&gt; "") then Recordset1__MMColParam = request.querystring("TXTComune")
%&gt;
&lt;%
Dim Recordset1__par1
Recordset1__par1 = "manca libretto di centrale"
if (request.querystring("desc_anomalia") &lt;&gt; "") then Recordset1__par1 = request.querystring("desc_anomalia")
%&gt;
&lt;%
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_caldaie_STRING
Recordset1.Source = "SELECT * FROM dbo.ASP_conteggio_anomalie_tutte WHERE desc_anomalia = '" + Replace(Recordset1__par1, "'", "''") + "' or TXTComune = '" + Replace(Recordset1__MMColParam, "'", "''") + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0

response.write recordset1_par1
%&gt;
&lt;%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%&gt;
&lt;%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

' set the record count
Recordset1_total = Recordset1.RecordCount

' set the number of rows displayed on this page
If (Recordset1_numRows &lt; 0) Then
Recordset1_numRows = Recordset1_total
Elseif (Recordset1_numRows = 0) Then
Recordset1_numRows = 1
End If

' set the first and last displayed record
Recordset1_first = 1
Recordset1_last = Recordset1_first + Recordset1_numRows - 1

' if we have the correct record count, check the other stats
If (Recordset1_total &lt;&gt; -1) Then
If (Recordset1_first &gt; Recordset1_total) Then Recordset1_first = Recordset1_total
If (Recordset1_last &gt; Recordset1_total) Then Recordset1_last = Recordset1_total
If (Recordset1_numRows &gt; Recordset1_total) Then Recordset1_numRows = Recordset1_total
End If
%&gt;
&lt;%
Set MM_rs = Recordset1
MM_rsCount = Recordset1_total
MM_size = Recordset1_numRows
MM_uniqueCol = "desc_anomalia"
MM_paramName = "desc_anomalia"
MM_offset = 0
MM_atTotal = false
MM_paramIsDefined = false
If (MM_paramName &lt;&gt; "") Then
MM_paramIsDefined = (Request.QueryString(MM_paramName) &lt;&gt; "")
End If
%&gt;
&lt;%
' *** Move To Specific Record: handle detail parameter

If (MM_paramIsDefined And MM_rsCount &lt;&gt; 0) Then

' get the value of the parameter
param = Request.QueryString(MM_paramName)

' find the record with the unique column value equal to the parameter value
MM_offset = 0
Do While (Not MM_rs.EOF)
If (Cstr(MM_rs.Fields.Item(MM_uniqueCol).Value) = param) Then
Exit Do
End If
MM_offset = MM_offset + 1
MM_rs.MoveNext
Loop

' if not found, set the number of records and reset the cursor
If (MM_rs.EOF) Then
If (MM_rsCount &lt; 0) Then MM_rsCount = MM_offset
If (MM_size &lt; 0 Or MM_size &gt; MM_offset) Then MM_size = MM_offset
MM_offset = 0

' reset the cursor to the beginning
If (MM_rs.CursorType &gt; 0) Then
MM_rs.MoveFirst
Else
MM_rs.Close
MM_rs.Open
End If
End If

End If
%&gt;
&lt;%
' *** Move To Record: if we dont know the record count, check the display range

If (MM_rsCount = -1) Then

' walk to the end of the display range for this page
i = MM_offset
While (Not MM_rs.EOF And (MM_size &lt; 0 Or i &lt; MM_offset + MM_size))
MM_rs.MoveNext
i = i + 1
Wend

' if we walked off the end of the recordset, set MM_rsCount and MM_size
If (MM_rs.EOF) Then
MM_rsCount = i
If (MM_size &lt; 0 Or MM_size &gt; MM_rsCount) Then MM_size = MM_rsCount
End If

' if we walked off the end, set the offset based on page size
If (MM_rs.EOF And Not MM_paramIsDefined) Then
If (MM_offset &gt; MM_rsCount - MM_size Or MM_offset = -1) Then
If ((MM_rsCount Mod MM_size) &gt; 0) Then
MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
Else
MM_offset = MM_rsCount - MM_size
End If
End If
End If

' reset the cursor to the beginning
If (MM_rs.CursorType &gt; 0) Then
MM_rs.MoveFirst
Else
MM_rs.Requery
End If

' move the cursor to the selected record
i = 0
While (Not MM_rs.EOF And i &lt; MM_offset)
MM_rs.MoveNext
i = i + 1
Wend
End If
%&gt;
&lt;%
' *** Move To Record: update recordset stats

' set the first and last displayed record
Recordset1_first = MM_offset + 1
Recordset1_last = MM_offset + MM_size
If (MM_rsCount &lt;&gt; -1) Then
If (Recordset1_first &gt; MM_rsCount) Then Recordset1_first = MM_rsCount
If (Recordset1_last &gt; MM_rsCount) Then Recordset1_last = MM_rsCount
End If

' set the boolean used by hide region to check if we are on the last record
MM_atTotal = (MM_rsCount &lt;&gt; -1 And MM_offset + MM_size &gt;= MM_rsCount)
%&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;impianti anomali&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;/head&gt;
&lt;body bgcolor="#FFFFFF" text="#000000"&gt;
&lt;table width="685" border="1" height="100%" align="center"&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;
&lt;p&gt;&lt;img src="images/top.GIF" width="685" height="122" usemap="#Map" border="0" align="top"&gt;
&lt;map name="Map"&gt;
&lt;area shape="rect" coords="3,96,41,119" href="logout.asp" alt="pagina di logout" title="pagina di logout"&gt;
&lt;area shape="rect" coords="44,97,113,118" href="ricerca.asp" alt="pagina di ricerca" title="pagina di ricerca"&gt;
&lt;area shape="rect" coords="116,96,218,118" href="stat.asp"&gt;
&lt;/map&gt;
&lt;/p&gt;
&lt;table width="80%" border="1" class="unnamed1" align="center"&gt;
&lt;tr bgcolor="#336699"&gt;
&lt;td&gt;
&lt;div align="center"&gt;&lt;b&gt;&lt;font color="#FFFFFF"&gt;Impianto&lt;/font&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td width="20%"&gt;
&lt;div align="center"&gt;&lt;b&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;table width="80%" border="0" align="center"&gt;
&lt;%
While ((Repeat1__numRows &lt;&gt; 0) AND (NOT Recordset1.EOF))
%&gt;
&lt;tr&gt;
&lt;td&gt;&lt;%=(Recordset1.Fields.Item("ID").Value)%&gt;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%&gt;
&lt;/table&gt;
&lt;p&gt;&nbsp;&lt;/p&gt;
&lt;p align="center"&gt;&nbsp;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top" height="28"&gt;&lt;img src="images/base.gif" width="685" height="28"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;div align="center"&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;%
Recordset1.Close()
%&gt;


2.907 messaggi dal 15 maggio 2001
Contributi
AAAAAa sti programmi che compilano tutto il codice automaticamente SONO una rovina !!
Ti consiglio di scrivere il codice a mano !! Fai più fatica ma quando poi lo devi modificare sai bene dove "mettere" le mani

Ti ho spiegato quali modifiche apportare........ basta che guardi il mio esempio e procedi sul tuo codice..

Non è che è un caso disperato Anzi ........ però non è che posso mettermi lì e farvi gli script capisci ? Io la dritta te l'ho data , come faccio anche con gli altri , però poi tocca a te capire bene come fare e procedere con il lavoro........
Se hai dubbi o vuoi chiedere consigli fai pure noi siamo qui per dare una mano

<font size=3> -¦» Rome Webmaster «¦- </font id=size3><font size=2> <b> [</b> Alla prossima<b> ]</b> </font id=size2>

Gabriele Romeo
<b>Community Manager di</b> http://www.aspitalia.com

Torna al forum | Feed RSS

ASPItalia.com non è responsabile per il contenuto dei messaggi presenti su questo servizio, non avendo nessun controllo sui messaggi postati nei propri forum, che rappresentano l'espressione del pensiero degli autori.