% if IsObject(Session("steel_con")) then Set Conn=Session("steel_con") Else Set conn= Server.CreateObject("ADODB.Connection") conn.open "steel006","","" Set Session("steel_con")=conn end if sql="select * from hot" Set RS = Server.CreateObject("ADODB.RecordSet") RS.Open sql, Conn, 3,3 %> <% ' Constant representing the number of images. ' This is used in Methods 1 and 2. Const NUMBER_OF_IMAGES = 3 ' Initialize the random number generator. This is the ' command that tells the computer to give us psedo-random ' numbers when we use Rnd later. Randomize Dim intImageIdToShow ' Random Id we generate Dim arrImages(2,4) ' Array to hold image parameters ' Set up our 2D array with the values ' In my setup the first number is basically representing ' an image id and each image has an associated filename, ' width, height, and alt tag text. rs.movefirst For i=0 to 2 sql1="select img1,img2,img3,img4,img5 from hot where id like "&rs.fields("id") Set RS1 = Server.CreateObject("ADODB.RecordSet") RS1.Open sql1, Conn, 3,3 arrImages(i,0) = rs1.fields("img1") arrImages(i,1) = rs1.fields("img2") arrImages(i,2) = rs1.fields("img3") arrImages(i,3) = rs1.fields("img4") arrImages(i,4) = rs1.fields("img5") rs.movenext next ' Generate a random number based on the bounds of the ' array we just set up. Notice the ", 1" in the LBound ' and UBound calls. This indicates I want to use the ' bounds from the first dimension. It's the default so I ' could have left it off, but I thought I should include ' it for reference in case you decide to use the array ' differently then I did and need the bound from a ' different dimension. intImageIdToShow = Int((UBound(arrImages, 1) - LBound(arrImages, 1) + 1) * Rnd + LBound(arrImages, 1)) ' Show the image: %>
|
HOT MODELS |
|||||||
|
Home or Hospital, Life or Death...Choice is your's In Road Accidents*, Approx. 2000 people every year in Delhi alone. Worst hit are the two wheeler riders. Moreover many more thousands suffer from comma/paralysis/other head injuries. In such eventualities Wearing a Good Helmet decides whether the rider goes home or to the hospital. * Source: Delhi Traffic Police Website Steelbird Hi-Tech
India Ltd |