aspÏÂÀÁбíÇóÖú - Web ¿ª·¢ / ASP
ÓÉÓÚÒ³ÃæÓжà¸ölist£¬Ëì±àÁ˸öfunction list333£¬ÒÔ±¸µ÷ÓÃ
<% function list333 (a,b,c,d)
response.Write "<select name="&d&">"
response.Write "<option value="">ÇëÑ¡Ôñ</option>"
set rs=server.createobject("adodb.recordset")
sql = "SELECT * from "&a&" "
rs.open sql, adocon, 1, 1
if rs.eof or rs.bof then
response.end
else
do while not rs.eof or rs.bof
response.Write "<option value="&rs(""&c&"")&">"&rs(""&b&"")&"</option>"
rs.movenext
loop
end if
response.Write "</select>"
rs.close
end function
%>
ÔÚδ¼ÓÈëºìÉ«µÄÒ»¾äʱһÇÐÕý³££¬¼ÓÈëÁ˺ìɫһ¾äºó£¬µ¥¸öµ÷ÓÃlist333£¬²»ÏÔʾ¡°ÇëÑ¡Ôñ¡±Ñ¡Ïһ¸öÒ³Ãæµ÷ÓÃ5´Îʱ£¬Ö»ÏÔʾ3¸ölist¿ò£¬ÇÒÄÜÏÔʾ¡°ÇëÑ¡Ôñ¡±Ñ¡Ïî¡£ÇëÎÊÕâÊÇÔõô»ØÊ£¿ÔÚÏߵȸßÊÖ½â´ð
¿´ÁËһϴúÂë
do while not rs.eof or rs.bof
response.Write "<option value="">ÇëÑ¡Ôñ</option>"//Ó¦¸Ã·ÅÔÚÕâÀï
response.Write "<option value="&rs(""&c&"")&">"&rs(""&b&"")&"</option>"
response.Write "<option value="">ÇëÑ¡Ôñ</option>"
ÀïÃæÓõ¥ÒýºÅ
Ïà¹ØÎÊ´ð£º
aspÐéÄâÖ÷»úʵÏÖα¾²Ì¬µÄ·½·¨£º
1¡¢ ÖØÐ´url²ÎÊý
Step1: ½¨Á¢Ç°Ì¨Îļþindex.asp£¬ÐÞ¸Äurl²ÎÊýÐÎʽ¡£ÓÉÓÚ¶ÁÈ¡Êý¾Ý¿âÖеļǼ²»ÊÇרÌâµÄÖØµã£¬¹ÊÖ±½Ó¸ø³ö:
<!--#include file="config.asp" -->
&l ......
1.asp.net×öµÄÒ»¸ö´ðÌâÒ³Ãæ£¬ÈçºÎʵʱÏÞʱºó×Ô¶¯Ìá½»£¬Çë´ó¼Ò¸øµã˼·
ÏÞʱµÄʱ¼äÐÅÏ¢´æ·ÅÔÚÊý¾Ý¿âÖÐ
2.Èç¹û´ðÌâʱ¼äÉèÖõĽϳ¤£¬ÈçºÎ·½Ê½session³¬Ê±ºóÒ³ÃæÎÞЧ
лл
ÓÃjs·½·¨À´¿ØÖÆ
»Ø¸´ÄÚÈÝÌ«¶ÌÁË¡£¡£
js ......
¹ØÓÚÍøÕ¾°²È«µÄÎÊÌ⣡
ÎÒÁ˽⵽µÄÍøÕ¾°²È«ÎÊÌâ°üÀ¨£º
sql×¢Èë©¶´ºÍ±©¿â©¶´»¹ÓÐÉÏ´«Â©¶´
³ýÁËÕâЩ»¹ÓÐÆäËûµÄ©¶´Ã´£¿
×¢Èë©¶´¿ÉÒÔͨ¹ý¹ýÂËÀ´·ÀÖ¹
±©¿â©¶´Ôõô·ÀÖ¹
»¹ÓÐÈËÉÏ´«µÄľÂíÊÇ.gif
ÕâÖÖ©¶´Ôõôȥ± ......
ÔÚPHPÖÐÓÐûÓÐÏñASPÖеļǼ¼¯(ADODB.Recordset )ÕâÖÖÀàÐ͵ĶÔÏó?¿É²»¿ÉÒÔÏñÔÚASPÖÐÒ»Ñùͨ¹ý¼Ç¼¼¯À´¸üÐÂÊý¾Ý¿â.ÈçÏÂÃæÕâÑù.
VBScript code:
set rs=server.createobject("adodb.recordset")
......