Display Random, Unique Pics
I am trying to get random, unique pics to display but for some reason, I sometimes get the same pics showing twice.
could someone kindly shed some light on this Code: ...
I am trying to get random, unique pics to display but for some reason, I sometimes get the same pics showing twice.
could someone kindly shed some light on this Code: ...
I have y pic's on the server and each time someone visits the site I want to display x of them randomly.
View Replies View RelatedI have a database with 20 companies and their links in it. Ive tried to develop some code that i found in another forum while i was searching for a solution to 'unique random links' but, although i feel im close, Code:
View Replies View RelatedThe codes below have some prob.It works well when the link as shown with the highlighted green is click as it passes the id to file.asp to show the pic in a new window.I now want it to show it in the same window itself.I mean i dun have to click the link to show the picture.It just will show the pic as shown in highlighted red.But all it comes out is the binary form. Code:
View Replies View RelatedHow can I generate a unique random number?
View Replies View RelatedI have to develop an online quiz on my website. the site is developed in ASP.
i have a access database of the questions, the multiple ans.s and the correct ans. every quest. has an unique id.
i want a way by which any 10 'unique' quests. will be selected from the database everytime an user takes the test.
I want to provide random image on my asp page. the image will display according to products searched by user.
e.g.
if user enter pharma machine in search box, in result page the banner of pharma company will display. i.e. the banner of manufaturer/exporter of pharma machine will display.
for this i have comapny info table in database
table: comapny_info
fields in comapny_info:
company_name
products (comapny products)
description (company_description)
banner (yes/no)
dusring registration, comapny has to specify whether it wants banner or not. so if there is yes in banner and prodcuts match the search string then banner will display.
this is according to the product seaarched by user.
any idea?
I am doing a simple program which display random records to students.The student table has the following fields(Access Database) Code:
1.Studentid-Number
2.Studentname-Text
3.Class-Text
4.Ans-Text
and Question table as
1.Questionid-Number
2.Questions-Text
Now What i am trying to do is , when the first time is student is login,he wil be shown a random record from the question and his answered wil be stored in the Ans field of the student table with column separeated.
The he will be redirected to the same page with one new question.This question should not be in the Ans Field, and must be randomly generated.I am using this code.But this not working. Code:
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. Code:
View Replies View RelatedI have this code that displays record sets at random, but some of time the results are less than the minimum set, which is 5 records. It is less, or none at all. What I need is for the asp to display records randomly on each submit.
Currently, the asp runs so that the whole recordset is different, i.e. Random. I am a little concerned about the load on the server by running such a script....perhaps someone can clarify.
'Set the number of records to display on each page by the constant set at the top of the script Code:
i want to display images in my search result page according to search text enetered by user. and i want more than one images display randomly.
View Replies View RelatedOn my index page I have got an area for one product to be displayed randomly from the
database. I have got it workign, but there is one problem i cant get my head around, here is the code so far:
' Initialize ASP RND() function
Randomize()
intRandomNumber = Int (1000*Rnd)+1
strsql = "SELECT TOP 1 art_Artist, art_Title, Rnd(" & -1 * (intRandomNumber) & "*cat_ID)" &_
"FROM eventDisplay " &_
"ORDER BY 3"
The code above isnt working and its when i try and draw out more that one value, as in art_Artist and art_Title.
It works fine if all I want is art_Artist, but as i said when i try to draw out more than one value the randomize function doesnt work.
I’m having problems on how to randomiz numbers and delete the ones that have been displayed.
My first step is to take some numbers:
21, 32, 35, 4, 15 and randomize theese so the ouput may look something like this:
35, 21, 15, 32, 4
My second step is to display the first number (35), then when a user clicks on a link I want the second of my random number (21) to be displayed and I also want to delete the first number (35) that has been displayed. And this routine (display number, delete previous number) should continoue untill there is no more numbers. So again, I wnat to step through all my random numbers and delete the ones I have displayed.
Example: ....
I Have searched the forum but have no solution to this problem.
I want to display my records in a random order. I loop through my records so I don't know how many records will be displayed. I dont want to count the records and then use the TOP statement. I'm looking for a better solution.
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open SELECT test FROM testTable WHERE testId = 1, objConn
Do While Not rs.EOF
Response.Write "<b>" & rs("test") & "</b>" <- I want theese records to be displayed in random order
rs.MoveNext
Loop
Anyone has a solution to this problem?
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.
<% Dim rstResult
Dim strSQL
Dim img(100)
imgID = 0
set rstResult = Server.CreateObject("ADODB.Recordset")
strSQL = "sp_sel_TilesByType 'O'"
rstResult.Open strSQL, strConnect
set rResult = Server.CreateObject("ADODB.Recordset")
sSQL = "sp_sel_TilesByType 'O'"
rResult.Open sSQL, strConnect
if not rResult.EOF then
do while not rResult.EOF
response.write("hi")
imgID = imgID + 1
img(imgID) = "images/tiles/" & rResult("TileImage")
response.write(img(imgID))
rResult.movenext
loop
end if
if not rstResult.EOF then
intVendorID = 0
do while not rstResult.EOF
if intVendorID <> rstResult("VendorID") then
rndNumber = RandomNumber(imgID)
Response.Write "<p>"
Response.Write "<a href=javascript:popWin('tileview.asp?" & rstResult("TileID") & "','',1,1,1,1,700,600);>"
'Response.Write "<img src=images/tiles/" & rstResult("TileImage") & " border=0>"
response.write(rndnumber)
Response.write "<img src=img(rndNumber)>"
Response.Write "</a>"
Response.Write "</p>"
end if
intVendorID = rstResult("VendorID")
rstResult.MoveNext
loop
end if
set rstResult = nothing%>
If you go to www.AstraAccounts.co.uk and click on any of the nav panel
folders on the left you may find that the images don't appear (white box
with red cross) for the tree-view items within these folders.
Yet if you right-click on any of these non-displaying images and go Show
Picture then these pics show without probs and will work for the rest of the
session.It only seems to be happening on IE 6 and intermittently at that.
Is it because I use ASP pages, although this particular nav bar is a
standard html page?Is it a recognised problem in IE 6?
Is there a way round it, ie via HTML code or a Microsoft patch?
I have a set of code for displaying information from the database. However now i can only view text with no pics... what can i add in order to see pics together with the text and what data type should i put for the pics in the database? Code:
View Replies View Relatedmade a page which should display one pic after another automatically as tho to say its generated from the database... not working tho
i have included some sample code as well in a txt file.
Basically I have created a small ASP site that allows a user to upload their
own pics via ASPupload so that they can be used on their site. I use a very
simple form with a INPUT file box to allow them to browse, select and upload
the picture. I then use ASPupload to save the file, get the file params and
then store these details in an Access DB as I can page through data far more
easily using a DB over a FileSysObj.
This works fine, but a number of users that use this site want to be able to
upload a large number of pics en masse. At this point, my knowledge of
problems to do with this are as follows:
a) ASPupload together with the trigger-happy ISP that I'm using means that a
total upload size at one time is really only about 800KB - 900KB at best
before the ISP triggers their script time out. Code:
how to extract a pic from ms access database.I used simple codes found online but it only gives me the binary codes not the pic itself.Wondering if anyone could help.I have already put the picture in the database.Now is extracting it.
View Replies View RelatedI run my applications perfectly, can make changes to my database, but I cannot upload Documents or Pictures Etc.Etc.I was able to with my Windows ME OS. I now run Windows 2000.
View Replies View RelatedHowever, what I want to do is include a request.querystring("ID"), so that IF an ID is defined, eg ID=3, , it will display the relevant (not random) information. I've tried this every way I can think and get type mismatches, etc etc. It's probably really simple but I can't see it.
<%
limit=3
redim link(limit)
redim image (limit)
link(1)="xxx"
image(1)="image1.jpg"
link(2)="xxx"
image(2)="image2.jpg"
link(3)="xxx"
image(3)="image3.jpg"
randomize
random=int(rnd*limit)+1
%>
<center>
<a href="<%= link(random) %>">
<img src="<%= image(random) %>" border="0"></a>
I just wanted to know whats the best way to generate 50 or say X amount of number at random without having to repeat any of the previous number...
so far I've the following:
[VBS]<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
function RandomNumber()
dim theRandom
Randomize
'RandomNumber = Int((upperbound - lowerbound + 1) * Rnd + lowerbound)
theRandom= Int((99 - (0) + 1) * Rnd + (0))
if (theRandom<10) then theRandom = "0" & theRandom
RandomNumber = theRandom
end function
%>[/VBS]
and then I've this in the body of HTML doc: Code:
We have the need to have a random token (a 16 char alphanumeric field) to be used as the key for one of our SQL tables. I have created a random token generator, however after only 3 months in production, it appears that we had an instance where a token that already existed in the tables was created. There are 3810 records currently in the database so it isn't like there are billions of records there.
I contacted an old college buddy of mine who is a mathematician, and he claims, assuming that random really does mean random, that the chances of getting a duplicate token are 1 in 79.5 septillion (79,500,000,000,000,000,000,000,000).
So my conclusion is that this was either a complete freak of nature occurance, or my random generator isn't really all that random. Here is the code behind how I am generating this: Code:
I need help with some asp code that would allow me to grab the last record id and add one to it for the new record being inserted.
I am new to asp and have been banging my head up against the wall trying to get this to work. I am currently using Visual FoxPro 6 for my database.
The SQL statement I am trying to use is:
strSQL = "SELECT Max(contact_id) FROM CustomerContact;"
i'm building an ecommerce website and I want to create a unique orderID for each new order. My problem is that I don't want to have a random number but a number where each orderid is one higher then the last order like for example 4850323, 4850324, 4850325....
I tried to do this by using an application variable where 1 is added after every order but
this doesn't garantee a unique number because if IIS is reset it also resets the application variable.
I've a databse of product in which I've unique ProductCode plus a ID that increments by 1 (AutoNumber). both the code and ID are unique and there will be no duplicate but is it worth having both in the databse?
I mean, can I not just use the productCode and forget about the ID? does this makes any difference? as far as I can see I'll have no problem in using the ProductCode. how you'd do it.
Ok my boss wants to know if there is a way to display an unknown # of pics from folder onto a web page ASP using VBScript or JavaScript... doesn't really matter.
You don't know the names of the pics or how many are in the folder just that you want to display all the pictures in the folder...
I am trying to generate a random number. I am using randomize and then rnd to return a decimal number between 100 and 120. This will give me a longitude. I am doing something similar to generate a latitude.
I created this on a page which refreshs every minute. I put these points into a map and they are showing up in groups of straight lines. Since rnd is time based will refreshing every 60 seconds return similar numbers?
Whats the best way to create a Unique ID and insert it into a Access DataBase? the field that holds this is a text field, and is called company ID.
Its a text field because it seems to cause less hassle
I have a list from a database which I have made into a dropdown box, with each option as one line from the list.
At the moment I have several repeat values which I do not want.
I can set up a series of nested if statements and loops to remove the duplicate values but I would expect there to be a function which does this much more easily.My question is:
Is there an easy way of only displaying unique values from a database using ASP and SQL.
This is about a simple form validation in asp using javascript.there is one field called invoice_number which requires an unique invoice number as input. Whenever user inputs duplicate values message should pop up as warning on submit of the form. A sql fetches all the invoice nos. from database into an array using getrows.how do i use the result of getrows in javascript to perform client side validation
View Replies View RelatedI am trying to find a best algorithm to generate unque id(alphanumeric less than 10 character long - not GUID) for entering orders in orders table for an e-commerce site.
View Replies View Related