Display X Random Pics Out Of Y Total
I have y pic's on the server and each time someone visits the site I want to display x of them randomly.
View RepliesI have y pic's on the server and each time someone visits the site I want to display x of them randomly.
View RepliesI 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: ...
The 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 Related i have a small issue with displaying total
heres what i need to do
if its 11 * 7 =77
i need to print 77.00
if its 7.95 * 3 =23.85 then its right
so when its whole number i want to put a .00
is this possible
here is my code for it
Code:
i'm using command object like this:
objCommand.CommandText = strSQL
strSQL being a SELECT string.
then executing it:
Set rsRec = objCommand.Execute
how can i get total number of records found, changing the line above to this:
Set rsRec = objCommand.Execute totRec
gives me an error and doing just this:
totRec = rsRec.RecordCount ....outputs -1
I'm trying to display records from an MS Access DB (*.mdb) in an ASP page (table).. I don't want to display all the records though, I just want to display the total of these records..i.e in my table I would like to show how many calls someone has closed this year..(number)
Joe Bloggs ---> 100 Closed
Is this possible? I was thinking that I need to write an ADO that includes COUNT but I'm not too sure how to write this.. Here's what I have so far: Code:
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%>
I 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 RelatedIf 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 have been asked to design a page where users login.
The users list is accessable from a drop down list which is taken from an SQL server table
The user, when selected then click next to login to a page where their name, associated with thier username is displayed.
Now I am a total newbie to this, can anyone guide me in the right direction?
Im trying to figure out how i can do the following:
I used a search script to select data from the database now each record has a figure such eg. £125.56 and so you can end up with rows like:
£125.56
£12.34
£.456.76
What I want to be able to do is have a select box to the right hand side where you select certain records and if possible at the bottom will have a live update showing the total of the selected items.
Does anybody know of a script?
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?
I am trying to add the price and shipping to equal the total price and display it in a table(receipt) I am able to get the price and shipping and handling to write to the page, but not sure how to add them together to get the total price:
The below code gives me $40.00$ 3.00 I want it to show as $43.00 ($40 + $3.00)if they ordered 500 business cards or $75.00 ($72 + $3.00)if they ordered 100 business cards.
<%
quantity = Request.QueryString("quantity")
If (quantity = "500") Then
price = "$40.00"
Else
price = "$72.00"
End If
%>
<%
shipping = "$ 3.00"
total = (price + shipping)
%>
I have an asp page that gives records that shows number of days like so:
<% Days = RSItin("Depart") - RSItin("Arrive")%>
<% response.write days %> days
How do I get the total number of days - ie:
Record 1 2 days
Record 2 4 days
TOTAL 6 days
I have a list of data in a database(access). How can I get the total rows in the database?
View Replies View RelatedI have a column which i store my totals (price) and i want to sort the records by total.
simple way of ordering as ORDER BY doesn't give correct solution since it sort according to the first number. like this:
1
24465
27184654
i want to sort it like
27184654
24465
1
do you know how?