1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
<html>
<body>
<%
x=request.form("c1")
dim con
dim rs
dim rs2
set con= server.createobject("ADODB.connection")
con.open"Provider=SQLOLEDB.1;Persist Security Info=False;User ID=ali;Initial Catalog=Northwind;Data Source=PC25"
set rs2=con.execute("select * from categories")
%>
<form name="form1" method="post" action="pro.asp">
<select name="c1">
<% do until rs2.eof %>
<option value="<% = rs2(0) %>"><% =rs2(1) %> </option>
<% rs2.movenext
loop %>
</select>
<input type="submit" name="Submit" value="Envoyer">
</form>
<%
if x="" then
set rs=con.execute("select * from products")
else
set rs=con.execute("select * from products where categoryID="& x &"")
end if
do until rs.eof
response.write"<table width='200' border='1' bgcolor=#FFFF99>"
response.write"<tr>" & "<td>"
response.write "numero de produit"& "</td>"& "<td width='20'>" &rs(0) &"</td>" & "</tr>"
response.write"</table>"
response.write "categorie : "& rs(3) & " <a href ='ll.asp'> <img src = './image/"& rs(0) &".jpg'> </a><br>"
response.write "mon du produit:" & rs(1) & "<br>"
response.write "prix unitaire :" & rs(5) & "<br>" & "<br>"
rs.movenext
loop
%>
</body>
</html> |
Partager