Casper Bang wrote in dk.edb.internet.webdesign.serverside.asp:
>
> Hvis du vil, så post den side hvor indlæggende gemmes i databasen her, og
> jeg kan vise hvor det skal smides ind.
>
Her er koden, jeg har selv forsøgt mig lidt- men jeg kan ikke helt finde ud af
at indsætte Response.Write smiley
<div id="indhold">
<h1 style="margin-bottom:0px"><%Response.Write strTitle%></h1>
<%
intPage = Request("page")
If isNumeric(intPage) = False Or intPage < 1 Then
intPage = 1
End If
function smiley(felt)
'opsætning
felt=Replace(felt,vbNewLine, "<br>")
felt=Replace(felt," "," ")
'Smileys
felt=Replace(felt,":)","<img src=""img/smiley/smileys141[1].bmp""
align=""middle"" alt="""">")
felt=Replace(felt,";S","<img src=""img/smiley/smileys147[1].bmp""
align=""middle"" alt="""">")
felt=Replace(felt,":P","<img src=""img/smiley/smileys121[1].bmp""
align=""middle"" alt="""">")
felt=Replace(felt,":|","<img src=""img/smiley/smileys113[1].bmp""
align=""middle"" alt="""">")
felt=Replace(felt,":D","<img src=""img/smiley/smileys118[1].bmp""
align=""middle"" alt="""">")
felt=Replace(felt,":'(","<img src=""img/smiley/smileys126[1].bmp""
align=""middle"" alt="""">")
felt=Replace(felt,":(","<img src=""img/smiley/smileys125[1].bmp""
align=""middle"" alt="""">")
'Bandeord
felt=Replace(LCase(felt),"fuck","f*ck")
felt=Replace(LCase(felt),"idiot","idi*t")
felt=Replace(LCase(felt),"luder","l*der")
felt=Replace(LCase(felt),"pik","p*k")
felt=Replace(LCase(felt),"fisse","f*sse")
felt=Replace(LCase(felt),"spasser","sp*sser")
smiley=felt
end function
Set rs = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT * from Guestbook order by dato" ' sortering efter dato
strDSN = "DRIVER={Microsoft Access Driver
(*.mdb)};DBQ="&Server.MapPath("/jaja.mdb")
rs.Open strSQL, strDSN, 1
If Not (rs.BOF Or rs.EOF) Then
rs.PageSize = 5
rs.AbsolutePage = intPage
intRecCount = rs.PageSize
intPageCount = rs.PageCount
Response.Write "<p><b>Side " & intPage & " af " & intPageCount & "</b></p>"
Do While Not rs.EOF And intRecCount > 0
dtmDato = rs("Dato")
dtmDato = FormatDateTime(dtmDato,vbLongDate) & " kl. " &
FormatDateTime(dtmDato,vbLongTime)
Response.Write "<div style='border: solid 1px #fff;padding: 8px;
background-color: #333333'>Den " & dtmDato & " skrev "
If Len(rs("Email")) > 0 Then
Response.Write "<a class='tlink' href='mailto:" & rs("Email") & "'>" &
rs("Navn") & "</a><br />"
End If
Response.Write "<span class='overskrift5'>" & rs("Overskrift") &
"</span><br />"
strContent= replace(rs("Kommentar") & "" ,VbCrLf,"<br />")
Response.Write strContent & "</div><br />"
intRecCount = intRecCount - 1
rs.MoveNext
Loop
End If
rs.Close
Set rs = Nothing
Response.Write "<p>Gå til side "
For intNum = 1 To intPageCount
Response.Write "<a class='link2' href=/gb.asp?page=" & intNum & ">" & intNum &
"</a> "
Next
%>
--
Vil du lære at kode HTML, XHTML, CSS, SSI, ASP eller ASP.NET?
- Pædagogiske tutorials på dansk
- Kom godt i gang med koderne
KLIK HER! =>
http://www.html.dk/tutorials