Random Image And Information From Db

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


ADVERTISEMENT

Random Image

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

Random Image

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

Random Image

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

Random Image

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

Random Image With Autorefresh?

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

Random Image For Validation

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

Random Image Display

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

Random Image Rotation

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

Random Image Display

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

Random Image And Text Display

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

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 View Related

Random Image FSO Script Working Great

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 Do I Make Random Images Not Random?

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

Making It Random (getting Random Numbers)

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:

View Replies View Related

Random Token Generator - Not Really Random

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

Random Number Not Random

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?

View Replies View Related

Display An Image From Access, Stored As Location Name Not Actual Image.

I have a client who has had a ASP site with an Access database for several years. It stores information for the used cars on his lot. I have stored text in the database that points to the location of the image for each record. Each record will have a thumb image that is supposed to display in a list of vehicles available then the user can select an item from this list and a new page displays with the information and the regular size image. So far everything has worked fine exept for the display of the images which are stored in a separate directory called veh-photos. All I get are image place holders. I am using Dreamweaver 2004 and and Access 2000 for the database.

Following is the code to list vehicles: ....

View Replies View Related

Open Image In 'Kodak Image Edit Control' With Web Browser

1.I want to show a image file of type '.tif' in the browser window; for that I'm writting as ASP code page.

2.This '.tif' type image can be shown better with 'Kodak Image Control'.

3.To have this 'Kodak Image Control' on my code page I just add it's ..ocx to tool box and then drag it from 'Toolbox' to the page.

4.Now after dropping this control to the code it's type is getting changed to 'object' instead of type 'ImgEdit'(and I think this is the
reason I don't get correct result).

5.On one button's 'Onclick' event I'm calling a javascript function with which I'm setting a 'Path'and'Display' property of a control.

6.And want to show a image at location -- '..MFTDRCMF919685173-62.tif' which get shown in new browser window but could not get shown in that particular control. That means the path is correct, then what is the problem?

For better understanding of problem I'm pasting a following code which I've tried up till now......
..................................................
<%@ Language=VBScript %>
<% OPTION EXPLICIT %>

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">

<SCRIPT LANGUAGE=javascript>
<!--
function showpic()
{
var path;
path = document.frmtif.path.value;
alert(path);
document.frmtif.ImgEdit1.Image =path;
document.frmtif.ImgEdit1.Display;
window.parent.self.open(path);
}

//-->
</script>

</HEAD>
<BODY bgColor=#ffe4e1>
<form name="frmtif">
The Image
<P>
<OBJECT id=ImgEdit1 style="WIDTH: 409px; HEIGHT: 218px" type="ImgEdit"
align=left
border=1 classid=clsid:6D940280-9F11-11CE-83FD-02608C3EC08A
name=imgtif></OBJECT>

<input type="hidden" name="path"
value="..MFTDRCMF919685173-62.tif">
<input type="button" name="show" value="Show" onclick="showpic();">
</P>

</form>
</BODY>
</HTML>

..................................................

View Replies View Related

Displaying Alternate Image When Image Source Not Found

I am creating a dynamic ASP VBScript page, which gets data from an Access database.

In the database, there is a field which holds a URL to an image. I can get the image to display fine, but where there is no file that matches the URL (i.e. a missing image) I want to display an alternative, default image (e.g. one that says "Awaiting Image"). The field is never blank, but the image file may not exist for all records in the database.

I think what I am trying to get to is the following:

If file exists (using URL from database to get location of image file) then
display image using the url from the database as the image source
else
display default image - hardcoded in program
endif

I have had a go and come up with the attached but I get an error with my if statement...

View Replies View Related

Image From Image Folder Into Byte Array?

I can convert an image that is retrieved from a FileUpload object into a byte array and insert it into the database..

When the user signs-up i wish tosimply insert into the Picture (DB Type = Image) field to an image i already have saved in my images folder?

Anyone know of a way to do this? Tutorials, articles or advise??!

View Replies View Related

Show Image From SQL Image Field?

Here is my code. I'm using 2 pages.

(Page 1) blob.asp

<%
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_blob_STRING
Recordset1.Source = "SELECT AboutPic FROM Elizabeth.GF_AboutUs"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Response.contentType = "image/jpg" 'Recordset1.Fields("AboutPic") <---Tried
both methods
size = Recordset1.Fields("AboutPic").ActualSize
blob = Recordset1.Fields("AboutPic").GetChunk(size)
Response.binarywrite(blob)
%>

(Page 2 Show the Image)

<%
Dim urlString
urlString = "?" & Request.QueryString
%>

<% Another rs to show other information as text from the same table %>

<body>
<img src="blob.asp<%=urlString%>" width="194" height="256">
</body>

View Replies View Related

Upload New Image Get Path Of Old Image

I'm working on a project where I'm suppose to upload a image to a server. The uploading works fine but when I want to change the image I uploaded to another image I can't get the filepath of the old image to show in my "filefiled"....is it possible to set a "value" where I can retrieve a filepath in a form if the input type is "file"?

View Replies View Related

Row Information

I have a database page with a table. I am using ASP and MSSQL on a Windows 2003 machine.

When I get the database information displayed in the table, I have something like the following:
<table>
<tr><td>row1</td><td>row1</td><td>row1</td<td>row1</td>
</tr>
</table>
The table has a total of 167 row that would be divided into five categories.
How can i get the above table to show:
<tr><td>row1</td><td>row2</td><td>row3</td><td>row4</td></tr>

View Replies View Related

Updating The Information

i'm trying to add the data of such client, some of his data have been added already but if i'm going to add or update his data (additional info.) what happened is the data is being added into new row not on the specific client. Code:

View Replies View Related

Error Information

I would like to email detailed error information from my website when an
error occurs.
I tried to use "On Error Resume Next" and if an error occurs check the Err
object and the AspError object returned by Server.GetLastError(), but I
didn't get the same amount of details as I can see on the browser's window
if I don't set "On Error Resume Next".
Is there a way to get detailed information from IIS ?

View Replies View Related

Status Information

I'm have a page which requires considerable database processing before writing the results to the page. I therefore wish to have a "Please wait message" up on the screen whilst the main page is processed.

I've tried Response.redirect hoping that the previous page will stay until all processing on th main page is complete and id drawn but this is not the case.

View Replies View Related

Clear Information

When I submit information i post it to a page and when it’s reloaded it runs as code accordingly if I refresh it re runs the asp because the information is still posted. How do I clear the posted information? Or possibly after it runs the asp code alter a value in the posted information.

View Replies View Related

Sending Information In A URL

I would like to have my application send a 'request' to an ASP page on my server. something like:-

http://www.mydomain.com/registration.asp?name="Fred"&age="25"

The browser then displays the full URL including the
parameters: name="Fred" and age="25"

Is there any way I can send the parameters without them appearing in the URL.

View Replies View Related

Retrieve Information

how can i retrieve information on a form page that once previously submitted by the user so that when the user goes back to that form page it will remember what they inputted instead of having them to retype it again? do i have to use session? can somebody please help me... what would be the easiest and most efficient for a newbie to tackle this problem?

View Replies View Related

Update Information

I have an update page, when user changes their info. Click update button then go to the update.asp:Code:

LastName= Request.Form("LastName")
Conn.Execute "Update UserInfo SET UserID='" & UserID & "'

'Send an email to confirm…
'Thanks for updating your information

If I refresh the page, it keep sending email. How can we prevent sending email if he/she keep refreshing the page (do not want to disable the refresh button).

View Replies View Related

Secure Information

I've an ASP page in wich the customer write his card number for the payment. How can I make this information secure when it's sent to the server?

View Replies View Related

Information Encrypted

I have a login page, which is not in SSL. However, the script that processes this information is. While that information passes to the login page to the page that processes this information, is this information encrypted?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved