webForumDet fria alternativet

Slumpa

5 svar · 234 visningar · startad av hacktheplanet

hacktheplanetMedlem sedan nov. 2001263 inlägg
#1

vad är felet på koden den laddas om hela tiden och sidan kraschar??

[kod]
<%
Response.Buffer = True
Set Rs = Server.CreateObject("ADODB.Connection")
DBPath = "DBQ=" & server.mappath("Database/members.mdb")
Rs.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & DBPath
Sql = "Select count(*) as Found from members where not bild = 'Bilder/Medlemmar/ingen.gif'"
Set Record = Rs.Execute(Sql)
Ialt = Record("found")
Sql = "Select * from members where not bild = 'Bilder/Medlemmar/ingen.gif'"
record.close
set record = nothing
Set Record = server.createobject("adodb.recordset")
record.cursorlocation = 3
record.open sql,rs
dim bilder(3)
randomize
for i = 0 to 3
found = false
do until false
RandNum = Int(Rnd * Ialt)
for j = 0 to i - 1
if bilder(j) = RandNum then
found = true
exit for
end if
next
if not found or i = 0 then exit do
loop
bilder(i) = RandNum

record.Movefirst
Record.Move randNum
Response.Write "<td><center>"
Response.Write "<a href='whois.asp?checkid=" & Record("id") & "'><img src='" & Record("bild") & "' alt='" & Record("username") & Record("username") & "' border = '1' width= '65' height= '77'></a>"
response.write "</td>"
next

record.close
rs.close
%>
[kod]

hacktheplanetMedlem sedan nov. 2001263 inlägg
#2

LarsG hjälp

VideMedlem sedan dec. 19998 577 inlägg
#3

LarsG svarar:

Du borde ändra:
do until false

till:
do until found

------------------
Doesn't 'expecting the unexpected' make the unexpected expected?
webeye.nu

hacktheplanetMedlem sedan nov. 2001263 inlägg
#4

fan då slumpas samma bild

jboy_87Medlem sedan aug. 20011 099 inlägg
#5

LarsG hjälp
slumpas samma bild

------------------
ASP är bäst fuck the rest!!!

hacktheplanetMedlem sedan nov. 2001263 inlägg
#6

LarsG men det slumpas samma bild ju

135 ms totalt · 3 externa anrop · v20260731065814-full.30151723
132 ms — hämta forumlista (db)
0 ms — hämta statistik (cache)
122 ms — hämta tråd, inlägg och bilagor (db)