SEARCH YOUR SOLUTION HERE  

random display of images

,

I am trying to retrieve images from the database and display them in a random order. The order of the images is supposed to change each time page is refreshed.

Below is my code, I am using an array to store the images but the images are not displayed for some reason. Any help would be appreciated.
Code:

Posted On: Friday 26th of October 2012 03:22:44 AM Total Views:  307
View Complete with Replies




Related Messages:

random string ?   (147 Views)
How do i produce a random string ... anything from A-Z or a-z or 1-9 for the password ... how do i do that ...
randomise the order of 6 ASP pages   (121 Views)
I am tring to display 6 asp pages one after another (clicking a next button), but want the order of those pages to be random. Any ideas or know of any example that do this Any suggestions greatly appreciated. I have no Javascript skills, only VBScript.
random numbers in database   (311 Views)
does anyone know how i get a databse to create random numbers. i thought i had done it with a formula but when i add a record to the database each one gets the same number.eg. users & user ID's with passwordsi want the password to be a random number that they can then change. i have =int(rnd()*10000) in my cell & it works great if i type into the table in the database. but when i get my asp to add an entry in it gives the same number as the last one. v wierd. any ideas Tonya
Pictures not displayed randomly   (154 Views)
I have a client application that uses an MSDE local database to build reports formatted as web pages including pictures. Pictures are stored in a virtual directory. Reports/web pages are built against a temp table in the MSDE with picture names in a field in the records. The problem is that not all of the pictures display, showing as broken links. This is apparently random, as rerunning the report results in different picture links being broken and those that showed broken previously now are automagically displayed. I believe it is only a matter of tweaking, but don't have a clue where to start. The page code is shown below:CODEShowroom Setup ReportShowroom Setup Report : Item Picture VendorPreliminary NumberFactory NumberSB Number Series DescriptionItem DescriptionSeries Factory Assortment CommentsItem Component Comments Showroom Setup Report Item Picture VendorPreliminary NumberFactory NumberSB Number Series DescriptionItem DescriptionSeries Factory Assortment CommentsItem Component Comments
Paging through a randomly ordered recordset   (153 Views)
HiI've been a long-time lurker and have always found solutions this way, however I've come up against a problem that I can't find any solutions to. This is my first post by the way.Basically, I've got a recordset that is being passed back to my ASP from an MSSQL sproc. The recordset is randomly ordered within the sproc using 'ORDER BY NEWID()'.I need to be able to page through the recordset. I'm actually using GETROWS, closing the recordset then paging through the resulting array.The problem is that when I go to page 2, the query is submitted again resulting in a new set of randomly ordered records being passed back.What I need to do is somehow keep the recordset from page 1 and page through that but I can't figure out how. Can anybody point me to some code or perhaps talk me through the logic I should be using. This is doing my head in!Many
Pull a random record from an access database   (151 Views)
Hi I'm trying to pull a random record from an access database. I'm using ASP and dreamweaver. Here is the code that I have generated:I tried putting the Rnd() function in the query in the database but that does not seem to work..
Showing random database entries   (226 Views)
I have 20 properties with their photopathname in a database. Each time a browser opens the website I wish to show 1 property at random so that all 20 properties will on average have a likelyhood of being shown once per 20 browser openings.Would anyone have an idea about how I could do it
seemingly random database errors   (239 Views)
Basicaly i put in a location through a link and want the output but this only works for half of my calls.I have 10 diferent location with and without data. it works for some with and without data and not others.The error I get isCODEError Type:(0x80020009)Exception occurred. /asset/show_location.asp, line 49Line 49 is the second call of rsPC("Patched")CODE Manic-----------------------------I've broken it again !!-----------------------------
pulling random entries, with restrictions   (179 Views)
Alright, here's my problem. I'm trying to pull 10 entries (people) from a table and present them, based on which state they live in and what their age is. I need it to present 10 random people but instead all it does is present the same 10 over and over again. I'm using code like this:strSQL = "SELECT * FROM Students WHERE Location = '" & Session("Location") & "' AND Age = '23'; "rsUsers.Open strSQL, objConn, adOpenDynamic, adLockOptimisticBut how do I make it so that it selects 10 random students, while still managing to keep the age and location requirements
non-repetitive random number   (123 Views)
hi , when i generate k random numbers in range from 1 to 100, usually i got a few numbers that repeat themselves. how can i generate the k non-repetitive random number i tried to do error checking, whether the new generated random number is the same with the old one, but it's not working
Problem with random numbers   (130 Views)
No, it's just that your voices know their stuff, and I'm afraid you'll put a tongue ring on your avatar. THAT would be scary.
Confused about a random # generating tutorial.   (245 Views)
hi i found this tutorial about random # generating tutorial. http://www.cprogramming.com/tutorial/random.html It uses rand() and srand() and uses the time function to use the system clock seconds as a seed. What im confused about is the tutorial is named "Getting Random Values in C and C++ with Rand" but all the examples include iostream meaning they are C++. They use cstdlib and time.h are they standard C libraries and you can use them in C++ because (not sure how it is termed) it is a superset/subset of C Is this the perfered method of random number generation in C Also they say that RAND_MAX is defined by the compiler. What is the best way to find out what your compiler defines RAND_MAX as Could you manipulate it by doing #define RAND_MAX (Whatever Number You Want as Max)
problems with generating a random letter   (232 Views)
Quote: Originally Posted by Eggbert >have you ever seen or even heard of an operating system in English or other >western languages whose character set is just a jumbled up mess! Yes, as a matter of fact, I have. I've been bitten by the 'jumbled up mess' of character sets enough times to seriously consider every assumption I might make. If you have written cross-platform programs for any length of time, you'll know that the first assumption you make will be the topic of the first bug report from your biggest customer, at 2:00am, on a Sunday, because any delay in deploying a fix will cost them a fortune. One tries to avoid calls like that. Ok, Ok, I'll eat my words and just go troll the lounge for the rest of the day. :p
random number.. always selects first record...   (182 Views)
I have a problem.. on my ASP page.. I'm randomly selecting some employees .. I randomly pick out 5 employees to be tested.. the problem is.. When i hit the get employee button.. it picks out 5 employees no problem.. but when i go to view report.. It adds in the first record in the database.. making it a total of 6 employees I see on my report.. which there should be only 5.. I been looking back and forth at this code.. but I don't see it.. could someone take a look ..
random SQL Server error? Help!   (178 Views)
I am randomly getting this error message with my production sites and I cant figure out what the problem is. (needless to say this is a bad problem to have in production)Here is the exact error that is displayed on the screen:----------------Microsoft OLE DB Provider for ODBC Drivers error '80004005'[Microsoft][ODBC SQL Server Driver] Timeout expired/forums/forumsdisplay.asp, line 240-----------------on line 240 i have the code that executes an objConn.Open command that opens the connection to my SQL server. The error is not occuring on a SQL query, but on the initial OPEN. I looked everywhere for Timeout settings and I just updated all of my drivers and applied the latest SP to my SQl server. If anyone can help I would greatly appreciate it.
Problem with random password   (164 Views)
Problem with random password Hi all. This function generate random password. Why in the generate password don't found words, but only numbers and special characters Can you help me kind regards viki Code: function randomKey() dim num, wor num = "1234567890!@$%&*+#-_.:{[]}" wor = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" Do Until len( cupon1 ) = 12 Randomize wor = Int( ( 27 * Rnd ) + 1 ) cupon1 = cupon1 & Mid( num, wor, 1 ) Loop randomKey = cupon1 end function
Assign a random number   (145 Views)
I have this simple application that I put together using ASP. It has an html form that submits to an access database through a simple ASP file. Its a survey form basically. One of the departments here wants to get some feedback from their students and in return for filling out the survey they will be entered into a drawing for a gift certificate. The catch is that the survey is anonymous. What they want to happen is each person is given a unique number at the end of the survey and they will pick one of those numbers randomly to see who the winner is. How can I possibly do this I am stuck. I think I may know what I need to do: Pull a unique number from a database and post it onto the HTML form near the submit button. Notate on the page that the user write the number down and when they hit submit it is inserted into the database along with the record. I have absolutely no idea how to do that. The HTML form submits into the database using this "add.asp" file: Code:
Extra space randomly inserted when using datalist control..Why?   (318 Views)
I have a user control that has a datasource and a datalist populated by that datasource. The datalist shows an image and then details below. My problem is that for some of the items, there is extra whitespace inserted above the images. Some items are perfect and others have this extra whitespace, which throws the layout off. See attached screenshot.
Display random row from access database - NEWBIE pls help   (215 Views)
Im currently using dreamweaver to develop my page. I have a few columns in my database: ID, Testimonial, Author and Link. Im just displaying the Testimonial, Author and Link. Dreamweaver prefabs a table for me along with the recordset. Dreamweaver also gives me the ability to select how many records to display and weather to display them in ascenting or descending order... I am only displaying 1 row/record and I have that set up but I want to display a random row/record or at least a different row/record every time the page is reloaded and I am wondering how to do this.. I have been all over the internet looking at tutorials and havent been able to make it happen so if someone could help me fill in the blanks I would greatly appreciate it. Here is my code: Code: Home  
I have a client asking me a valid question regarding random!   (255 Views)
I have a client asking me about random images on his site, basically I am using the following code:- PHP Code: Agreed its not the best code, but he is finding that the same image could be repeated like three times in a run. I have an include file which displays the image, and the random script is placed inside that include. So when he is going from page to page this is where the issue lies. Can anyone help me out here, is it even possible to have a different image load each time, and not have them repeating. I dont think that it is but I am most likely wrong, any advice, ideas, samples, links Cheers Trev