How To Create A Random Image Generator?
How bout I go about creating a section on my site that displays a random image, lets say:
1) every time the page is refreshed
2) in a certain amount of mins or hrs the pic changes
3) daily, monthly and so on?
Would I need a database of some sort or can it just be done with some asp code?
View Replies
ADVERTISEMENT
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:
View Replies
View Related
So we use the Randomize function and Rnd to make a random number. Well my numbers can hardly be called random. So I have to ask is those two functions dependent on the web server? The web server sucks so much that it cant generate new Random numbers?
How Random is this?
Game1
2006-05-14 20:01:32 You picked a 4 of Clubs
2006-05-14 20:01:34 You picked a 4 of Clubs
2006-05-14 20:01:35 You picked a 2 of Diamonds
2006-05-14 20:01:37 You picked a 2 of Diamonds
2006-05-14 20:01:38 You picked a 2 of Diamonds
And then I added a Session function which takes the Number generated and make sure that it doesnt happen twice in a Row. But then it just switches between two values.
Game2
2006-08-09 13:55:12 You got hit by 11276
2006-08-09 13:55:16 You recieved 88515m³ Ice.
2006-08-09 13:55:21 You got hit by 11276
2006-08-09 13:55:30 You recieved 88515m³ Ice.
2006-08-09 13:55:37 You got hit by 11276
2006-08-09 13:55:39 You recieved 88515m³ Ice.
If I had'nt had the Session function it would simply be "2006-08-09 13:55:12 You got hit by 11276" 4 times in a row or something.
So I ask myself what is wrong? Is it the server or is it faulty programming on my side?
iOre = Int(30000 * Rnd + 5000)
If IsEmpty(Session("OreRandom")) = False then
DO WHILE Session("OreRandom") = iOre
Randomize
iOre = Int(30000 * Rnd + 5000)
LOOP
End If
Session("OreRandom") = iOre
View Replies
View Related
I think most of you have run into the problem of generating random cards (shuffling them) in almost every programming language. If not here is your chance .Now I want to try this in ASP. Ya ya I know WHY ASP...because I want a challenge and want to see how you people would think of doing it.
---------------------------
Rules To Develope:
---------------------------
- 40 cards
- 4 different suits
- each suit 10 cards with number 10,9,8,7,6,5,4,3,2,1
All it has to do is generate an ASP page listed with the randomly generated cards.
View Replies
View Related
Does anyone know how to code in a very simple random number generator?
Basically, my ASP site is linked to an SQL d/base. What I want to do is have a "Random quote of the day"... the R.N.G. should spit out a number, and that number references the random_quote_ID in the d/base and spits it out.
View Replies
View Related
I have the following function which generates random strings:
function GenerateRandomStr(nLen, skipRandomize)
dim i, strTmp
if not skipRandomize then Randomize
strTmp = vbNullString
for i = 1 to nLen
strTmp = strTmp + Chr(fix(26 * Rnd) + 65)
next
GenerateRandomStr = strTmp
end function
But it is so happening that it is generating duplicate string which is causing the system to fail. Can anyone tell me why it is behaving in that way??
View Replies
View Related
I design auction templates and I need a way for my buyers to be able to fill out a form, click submit, and have a preview of the HTML template come up as well as the HTML coding so they can copy & paste it into their auction listing. Does that make sense?
I have NO experience with ASP programs but I was told by someone that this is what I need to get the results I am looking for. I do very well learning things on my own but this one has stumped me. I've spent many hours looking for any kind of tutorial or program that I could purchase.
View Replies
View Related
i'm looking for a free image gallery generator in ASP 3 on ASP+. I've already looked on sourceforge.net but no one seems to fit my needs which include:
- admin area to create/destroy galleries,
- upload/remove images,
- placing comments on images.
View Replies
View Related
I have done random image display with the help suggestion from this discussion form. now I want to provide link on each image. i.e. all the images display randomly, should have different link. is it possible? if yes, how?
View Replies
View Related
example:
When u see some sites ,
the advetisement images are changing ,
when ever the browser is refreshed...
.....
like tha i want to do that.....
View Replies
View Related
I have the below ASP function to display a random image from a folder.
<%
Function RandomImage(strPath)
Randomize()
If Right(strPath, 1) <> Chr(47) Then strPath = strPath & Chr(47)
strPhysical = Server.MapPath(strPath)
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("C:Inetpubwwwrootpag-siteimages
andoms")
Set objFiles = objFolder.Files
For Each objFile in objFiles
strFile = LCase(objFile.Name)
strFiles = strFiles & strFile & vbTab
Next
strImages = Split(strFiles, vbTab)
If UBound(strImages) > 1 Then
RandomImage = strPath & strImages(Int(Rnd(1)*UBound(strImages)))
End If
End Function
%>
and this places the image in the HTML
<img name="Intropic" src="<%=RandomImage("images/randoms/")%>" width="211" height="158" alt="" />
but sometimes the script places a ._ before the image file name in the outputted HTML?
View Replies
View Related
If I want a webpage to display a random image from about 20 images and not want the user's computer to load all 20 images and sacrafise the load time, can I use the following script? Is the following a good approach? Code:
<%
Const NUMBER_OF_IMAGES = 20
Randomize
Dim intImageNumber
intImageNumber = Int((NUMBER_OF_IMAGES * Rnd) + 1)
%>
<html><body>
<img
src= "images/header<%= intImageNumber %>.jpg"
width = "760"
height = "104"
>
</body></html>
View Replies
View Related
i have some code that displays a random image... and i have some code that refreshes a page ever x seconds. great.
what i want to do is, have sort of like a banner rotating system... not links, just displaying random images every x seconds on a portion of my website... im sure someone has done this before, but im not sure how to go on from here.
View Replies
View Related
I have a client that has a guestbook and they have been getting slammed with spam...
Would like it if someone could post a script to create one of those "input the letters you see here" scripts to prevent the spam bots from being able to post automatically....
View Replies
View Related
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?
View Replies
View Related
I am currently looking for a script similar to A List Apart Article Random Image Rotation. Unfortunately my clients host does not support PHP. I want to randomly rotate 3 images in the header section each time the page loads.
As it's only 3 images, I could turn to javascript, but then I would need to include that in every page. The header part of the site is an #include file, so I was thinking I wanted to do something like this.. Code:
View Replies
View Related
I was wondering if anyone knows how I can have a random product image shown on a page with information such as product info, price from the db?
View Replies
View Related
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 Related
On 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.
View Replies
View Related
This Random image script gets an image out of a folder so NO database is needed, just create a subfolder for your images and upload to your server ...
View Replies
View Related
how to create image with asp ?
View Replies
View Related
If I have height and width and pixel value from flash, How can I create jpg image from those values with ASP ?
View Replies
View Related
I need to create an impression tracking with just an image. My goal is to count (+track referrals) page impressions.
I have no clue of doing so. I know there is a way to do it using javascript and asp.
View Replies
View Related
I wish to create a page with a validation code (something like rapidshare.de or gmail, when u want to submit, u will required to type the characters in the image shown for validation)
any idea how to do it?
View Replies
View Related
I'm getting ready to start design on a random name generator. Basically a user would type in their first and last name and it would generate a random name pulling from a database. My question is this, what would be the best way to pull the random name? I was thinking of maybe just grabbing say the third letter of the first and last name and then matching them to a name, but I thought this would create to many duplicates. Maybe somebody out there can point me in the right direction.
View Replies
View Related
tell a good software that i can be using to generate my asp codes apart from code charge studio.
View Replies
View Related
Code:
The biggest n00b benefit I can see from Ruby on Rails, .NET, CakePHP or any framework/code generator is it's ability to auto create DAL and CRUD statments in a object oriented format.
View Replies
View Related
Helping a friend to create a site in ASP, he has a bit of ASP knowledge and I have none at all We are looking add being able to add the abilitly to create new forms on his new website. Does anybody know of a good ASP form generator?
View Replies
View Related
I am looking for a script or a tutorial on how to generate a web page by having a user fill in a few chosen fields and entering the information into some preprogrammed html code using variables.It would then display their page and underneath it the html code.
Exactly like this, but in asp or cold fusion:
http://www.tupics.com/freead/create.pl
View Replies
View Related
I am a web programmer and I have recently been involved in developing my first ASP.NET application written in C#. I am looking for a code generator to help me to implement the skeleton of the application.
I tried to search on the Internet and found a few, but none of them generate the stored procedures, the data access layer and the business layer. Can someone suggest me a good and bug-free code generator so I can focus on implementing the business rules rather than writing stored procedures and developing logic to load and save the data?
View Replies
View Related
Does anyone know of any decent ASP code generators.I would like a program that automatically builds all the code for searches, reports, etc, giving just the path to a Microsoft Access MDB file. I have tried and used aspmaker, and it works pretty good. I was just wondering if there are any other programs out there that anyone recommends. Also does anyone know of any other "GOOD" asp forums besides this one
View Replies
View Related
i am developing an e-move system. basically, this system required a customer to login first into the system before make any reservation. when a customer complete fill up a form with required data such as name, address, telephone number, email, date and time, i was wondering to give the customer a specific number as a reference number. customer will use this number to retrieve back the information if he has any changes to make and also to view the propose quotation from the mover company. my problem is, how can i include that particular process (reference number) into my e-move system?is there any auto number generator code/application?
View Replies
View Related
However, 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>
View Replies
View Related