/ Forside / Teknologi / Udvikling / ASP / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
ASP
#NavnPoint
smorch 9259
Harlekin 1866
molokyle 1040
Steffanst.. 758
gandalf 657
smilly 564
gibson 560
cumano 530
MouseKeep.. 480
10  Random 410
Forskellige links til samme database viser~
Fra : Kasper


Dato : 09-08-02 10:41

Jeg har syv links til samme til, men som henviser til forskellige
steder i databasen. Hvert link er taget fra et felt ved navn
"Overskrift".

Jeg har altså fin kontakt med min database. Men når jeg klikker
på disse dynamiske links, som browseren vel og mærke også læser
som forskellige, for jeg hele tiden den samme side fra, altså den
side som stammer fra første felt i tabellen. ved nogen hvorfor?

Jeg har lavet det hele i Acess og Dreamweaver. Her er koden:

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/Conn.asp" -->
<%
set rsBibl = Server.CreateObject("ADODB.Recordset")
rsBibl.ActiveConnection = MM_Conn_STRING
rsBibl.Source = "SELECT * FROM margenbibliotek ORDER BY
Overskrift ASC"
rsBibl.CursorType = 0
rsBibl.CursorLocation = 2
rsBibl.LockType = 3
rsBibl.Open()
rsBibl_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
rsBibl_numRows = rsBibl_numRows + Repeat1__numRows
%>
<%
' *** Go To Record and Move To Record: create strings for
maintaining URL and Form parameters

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&"
& MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""

' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepURL = MM_keepURL & NextItem &
Server.URLencode(Request.QueryString(Item))
End If
Next

' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepForm = MM_keepForm & NextItem &
Server.URLencode(Request.Form(Item))
End If
Next

' create the Form + URL string and remove the intial '&' from
each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth,
Len(MM_keepBoth) - 1)
if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL,
Len(MM_keepURL) - 1)
if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm,
Len(MM_keepForm) - 1)

' a utility function used for adding additional parameters to
these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<html>
<head>
<title>Margen Bibliotek</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="268" border="0" cellspacing="2" cellpadding="2"
height="82">
<tr>
<td>
<%
While ((Repeat1__numRows <> 0) AND (NOT rsBibl.EOF))
%>
<A HREF="biblmain.asp?<%= MM_keepNone &
MM_joinChar(MM_keepNone) & "Overskrift=" &
rsBibl.Fields.Item("Overskrift").Value
%>"target="hovedramme"><%=(rsBibl.Fields.Item("Overskrift").Value
)%></A> <br>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsBibl.MoveNext()
Wend
%>
<br>
</td>
</tr>
</table>
</body>
</html>
<%
rsBibl.Close()
%>


--
Vil du lære at kode HTML, XHTML, CSS, SSI eller ASP ???
- Pædagogiske tutorials på dansk
- Kom godt i gang med koderne
KLIK HER! => http://www.html.dk/tutorials

 
 
Søg
Reklame
Statistik
Spørgsmål : 177554
Tips : 31968
Nyheder : 719565
Indlæg : 6408852
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste