Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 31st, 2004, 09:43 AM
Registered User
 
Join Date: Aug 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default HELP PLEASE ...IMAGE LINK

I would like to put a picture on may page and I would like to use this picture as a button to execute an sql query, so when you clik on the picture you will hace displayed in the next page the product in the data base and other info like price for example.
I have this code to access the data base but I do not know how to use a picture s a buton to use it.
Can any one help please.
Maya

<%

Dim mySQL, myRS, CategoryID

CategoryID = CInt(Request.QueryString("CategoryID"))

mySQL = "SELECT ProductID, image, title, Category " &_

"FROM Categories INNER JOIN Products " &_

"ON Categories.CategoryID = Products.CategoryID " &_

"WHERE Products.CategoryID = " & CategoryID & " " &_

"ORDER BY Title"



Set myRS = Server.CreateObject("ADODB.Recordset")

myRS.Open mySQL, myConn

Response.Write "<p>The products in the category of <b>" & myRS("image") & "</b> are shown below:"

While Not myRS.EOF

Response.Write "<p><b><a href='products2.asp?ProductID=" &_

myRS("ProductID") & "'>"& myRS("image") & "</a></b><br>"

Response.Write "<img align='centre' hspace='5' vspace='5' src='graphics/" & myRS("Image") & "'>"

myRS.MoveNext

Wend

%>
PS: THIS MY EXAMPLE:

http://www.tigerdirect.com/applicat...lc.asp?CatId=12

MANY MANY THANKS

 
Old August 31st, 2004, 09:46 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
Default

hi,


  Response.Write "<p><b><a href='products2.asp?ProductID=" &_

myRS("ProductID") & "'>"& myRS("image") & "</a></b><br>"

Response.Write "<img align='centre' hspace='5' vspace='5' src='graphics/" & myRS("Image") & "'>"



Response.Write "<p><b><a href='products2.asp?ProductID=" &_

myRS("ProductID") & "'><img align='centre' hspace='5' vspace='5' src='graphics/" & myRS("Image") & "'></a></b></p>"










Similar Threads
Thread Thread Starter Forum Replies Last Post
image hosting (link to forums) aliusmankhan ASP.NET 2.0 Professional 14 August 31st, 2008 04:09 PM
create a moving link/image panuvin Javascript How-To 1 October 26th, 2007 07:09 AM
Image and Link in DataGrid Anantsharma ASP.NET 1.0 and 1.1 Basics 1 April 15th, 2005 12:00 AM
Simple subselect & image link ymoisan Excel VBA 0 May 4th, 2004 10:04 AM
dynamic link to image in report wolf27ea Access VBA 2 February 3rd, 2004 10:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.