Discussions
Categories
Groups
Advertisement
Child Item
Home
Topics
Technology & Internet
Software & Web Development
Development
ASP database
pat kenny
I have a html page called "INDEX.HTML" that has 5 links (the 5 links are brand names).
These 5 links all point to an ASP page called "PRODUCTS.ASP".
The "PRODUCTS.ASP" page is generated from data in a database called "AS3044".
The code is working and data is returned from the database, however I want the ASP page to return data based on the link clicked on the html page.
For instance if I click on the "Levis" link I want the ASP page to only return values from the database with the Levis in them.
I can allready do this in a static manner using this code :
<% sqltext= "SELECT * FROM Product WHERE brand = 'Levis' " %>
How do I make this code dynamic, i.e. recieve a value from the link clicked on the html page and pass it to the line of code above?
Find more posts tagged with
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Best Of
Advertisement
Advertisement
Comments
Seth Brundle
I had typed out the whole procedure for you but effin MSIE'e an accidental press of the tab followed by the backspace buttons ruined all that.
Try download the tutorial from
www.manastungare.com.
Killian
zAbbo
Use URL parametres, can`t remember now, but im sure Tony would give you a hand
< a href"=details.asp?item=levis">levis</a>
and the details page would be pulling the data which would be equal to the parameter you have assigned in the code.
Man i knew this inside out last year, not now tho
Seth Brundle
bugger it - here goes again :rolleyes:
step 1:- all links to the products should be like this <A HREF="products.asp?product=Levis"...
Step 2:- products.asp should contain the code to collect the product from the querystring as follows:-
<%
Dim qstring
qstring = Request.Querystring("product")
%>
Step 3:- base your SQL SELECT statement on this variable as follows:-
<%
Dim RS, theSQL
Set RS = Server.CreateObject("ADODB.Recordset")
theSQL = "SELECT * FROM AS3044 WHERE product='" & qstring & "'"
RS.Open theSQL, Conn
%>
Note:- the quotes around qstring in the select statement are as follows
single, double & qstring & double, single, double
it won't work if unlike this.
You should still read that tutorial though
K.
pat kenny
Cheers lads thanks for the help.