Display Random images with a link in ASP

Results 1 to 2 of 2

Thread: Display Random images with a link in ASP

  1. #1
    Join Date
    Dec 1969

    Default Display Random images with a link in ASP

    I now know how to display random images in ASP, but how would I display random images that are part of a database? I would like my browsers to be able to click on the images and go to the details page of the particular image.<BR><BR>Example:<BR><BR>Real Estate website with a Featured Properties section on home page. That featured property would be a random image from a database. That image would then link to a detailed page of that particular property.

  2. #2
    Join Date
    Dec 1969

    Default RE: Display Random images with a link in ASP

    I did something similar to this at my VW site (http://www.ohiovw.com)<BR><BR>You first set up a database table....<BR>Images_table<BR>-------------<BR>Image_id<BR>Image_addy<BR>Details_id<BR><BR>im age_id is an autonumber<BR>image_addy is the address to the picture<BR>details_id is the ID for the information for that picture in another table... (foreign key)<BR><BR>you set up a random number from a range from 1 to the number of pics you have...<BR><BR>Then you grab the corrisponding image from within the database<BR>("Select * from images_table where image_id = " & randomnumber)<BR><BR>then you display the image with a link to the viewing page...<BR>response.write("&#060;a href=""viewdetails.asp?details_id=" & objrec("details_id") & """&#062;&#060;img src="" & objrec("image_addy") & """&#062;&#060;/a&#062;")<BR><BR>Then you need to make a vewdetails.asp file that will open the database, and display the details from the details table that has the details_id that was passed to the page.<BR><BR>You can find examples and tutorials for making random numbers from www.aspin.com<BR><BR>Later,<BR>-- Whol

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts