Ciao a tutti...
Ho creato un piccolo notoziario (uso Dreamweaver)
Nella pagina "ScegliNews" appaiono i link che dovrebbero far aprire, poi, la pagina "News".
Ho impostato i collegamenti ipertestuali dei link della pagina "ScegliNews" passando come parametri URL l'ID della tabella del DB e il recordset "rsLeggiNews" della pagina "News" viene "filtrato, appunto, dall'ID ricevuto...o almeno dovrebbe..![]()
Infatti qualsiasi link venga cliccato si apre sempre il primo record (ID 1)
Vi posto il tutto:
Pagina "ScegliNews"
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<%
var rsScegliNews = Server.CreateObject("ADODB.Recordset");
rsScegliNews.ActiveConnection = MM_Conn_News_STRING;
rsScegliNews.Source = "SELECT * FROM News ORDER BY data DESC";
rsScegliNews.CursorType = 0;
rsScegliNews.CursorLocation = 2;
rsScegliNews.LockType = 1;
rsScegliNews.Open();
var rsScegliNews_numRows = 0;
%>
<%
var Repeat1__numRows = -1;
var Repeat1__index = 0;
rsScegliNews_numRows += Repeat1__numRows;
%>
<%
// *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
// set the record count
var rsScegliNews_total = rsScegliNews.RecordCount;
// set the number of rows displayed on this page
if (rsScegliNews_numRows < 0) { // if repeat region set to all records
rsScegliNews_numRows = rsScegliNews_total;
} else if (rsScegliNews_numRows == 0) { // if no repeat regions
rsScegliNews_numRows = 1;
}
// set the first and last displayed record
var rsScegliNews_first = 1;
var rsScegliNews_last = rsScegliNews_first + rsScegliNews_numRows - 1;
// if we have the correct record count, check the other stats
if (rsScegliNews_total != -1) {
rsScegliNews_numRows = Math.min(rsScegliNews_numRows, rsScegliNews_total);
rsScegliNews_first = Math.min(rsScegliNews_first, rsScegliNews_total);
rsScegliNews_last = Math.min(rsScegliNews_last, rsScegliNews_total);
}
%>
<%
// *** Recordset Stats: if we don't know the record count, manually count them
if (rsScegliNews_total == -1) {
// count the total records by iterating through the recordset
for (rsScegliNews_total=0; !rsScegliNews.EOF; rsScegliNews.MoveNext()) {
rsScegliNews_total++;
}
// reset the cursor to the beginning
if (rsScegliNews.CursorType > 0) {
if (!rsScegliNews.BOF) rsScegliNews.MoveFirst();
} else {
rsScegliNews.Requery();
}
// set the number of rows displayed on this page
if (rsScegliNews_numRows < 0 || rsScegliNews_numRows > rsScegliNews_total) {
rsScegliNews_numRows = rsScegliNews_total;
}
// set the first and last displayed record
rsScegliNews_last = Math.min(rsScegliNews_first + rsScegliNews_numRows - 1, rsScegliNews_total);
rsScegliNews_first = Math.min(rsScegliNews_first, rsScegliNews_total);
}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Pianeta Taxi News</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
<!--
.Stile18 {color: #FFFFFF; font-weight: bold; font-size: x-large; font-family: Arial, Helvetica, sans-serif; }
.Stile2 {font-size: 22px;
color: #000066;
font-family: Arial, Helvetica, sans-serif;
}
.Stile27 {
font-family: Arial, Helvetica, sans-serif;
font-size: 15px;
color: #000066;
font-weight: bold;
}
body {
background-color: #000066;
}
.Stile28 {color: #FFFFFF}
-->
</style>
</head>
<body>
</p>
<table width="900" border="2" align="center" cellspacing="0" bordercolor="#000066" bgcolor="#FFFFFF">
<tr>
<td width="459">[img]Logo.bmp[/img]</td>
<td width="211"><div align="center">
<p class="Stile2">News</p>
</div></td>
<td width="214"><object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="214" height="91">
<param name="movie" value="Film.swf" />
<param name="quality" value="high" />
<embed src="Film.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="214" height="91"></embed>
</object></td>
</tr>
<tr>
<td colspan="3" class="Stile27"> <%=(rsScegliNews_total)%> articoli pubblicati</td>
</tr>
<tr>
</p>
<p class="Stile27"></p>
<td height="5"></td>
</tr>
<% while ((Repeat1__numRows-- != 0) && (!rsScegliNews.EOF)) { %>
<tr>
<td height="30" colspan="3" class="Stile27">="><%=(rsScegliNews.Fields.Item("Titolo").Value )%></td>
</tr>
<%
Repeat1__index++;
rsScegliNews.MoveNext();
}
%>
<tr>
<td colspan="3"></td>
</tr>
<tr>
<td colspan="3">
<p class="Stile27"> </p>
<p class="Stile27"></p></td>
</tr>
</table>
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="33" height="33">
<param name="movie" value="torna.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#000066" />
<embed src="torna.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="33" height="33" bgcolor="#000066"></embed>
</object>
<span class="Stile28">Indietro
</span></p>
</body>
</html>
<%
rsScegliNews.Close();
%>
Pagina "News"
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<%
var rsLeggiNews__MMColParam = "1";
if (String(Request.QueryString("ID")) != "undefined" &&
String(Request.QueryString("ID")) != "") {
rsLeggiNews__MMColParam = String(Request.QueryString("ID"));
}
%>
<%
var rsLeggiNews = Server.CreateObject("ADODB.Recordset");
rsLeggiNews.ActiveConnection = MM_Conn_News_STRING;
rsLeggiNews.Source = "SELECT * FROM News WHERE ID = "+ rsLeggiNews__MMColParam.replace(/'/g, "''") + "";
rsLeggiNews.CursorType = 0;
rsLeggiNews.CursorLocation = 2;
rsLeggiNews.LockType = 1;
rsLeggiNews.Open();
var rsLeggiNews_numRows = 0;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Pianeta Taxi News</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
<!--
.Stile2 {font-size: 22px;
color: #000066;
font-family: Arial, Helvetica, sans-serif;
}
.Stile27 {
font-family: Arial, Helvetica, sans-serif;
font-size: 15px;
color: #000066;
font-weight: bold;
}
body {
background-color: #000066;
}
.Stile28 {color: #FFFFFF}
.Stile29 {font-size: 15px; color: #000066; font-family: Arial, Helvetica, sans-serif;}
-->
</style>
</head>
<body>
</p>
<table width="900" border="2" align="center" cellspacing="0" bordercolor="#000066" bgcolor="#FFFFFF">
<tr>
<td width="459">[img]Logo.bmp[/img]</td>
<td width="211"><div align="center">
<p class="Stile2">News</p>
</div></td>
<td width="214"><object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="214" height="91">
<param name="movie" value="Film.swf" />
<param name="quality" value="high" />
<embed src="Film.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="214" height="91"></embed>
</object></td>
</tr>
<tr>
<td colspan="3"></td>
</tr>
<tr>
</p>
<p class="Stile27"></p></td>
</tr>
<tr>
<td colspan="3">
<p class="Stile27"><%=(rsLeggiNews.Fields.Item("Titol o").Value)%>del <%=(rsLeggiNews.Fields.Item("data").Value)%></p>
<p class="Stile29"><%=(rsLeggiNews.Fields.Item("Testo ").Value)%></p> </td>
</tr>
</table>
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="33" height="33">
<param name="movie" value="torna1.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#000066" />
<embed src="torna1.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="33" height="33" bgcolor="#000066"></embed>
</object>
<span class="Stile28">Indietro
</span></p>
</body>
</html>
<%
rsLeggiNews.Close();
%>
Qualcuno può dirmi dov'è la magagna?
Grazie a tutti per l'attenzione..![]()

27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="214" height="91">
Rispondi quotando
è in neretto... aguzza la vista...
