php我不知道.
告诉你asp+sql2000的吧.
下拉类表:
<select name="channel" class="FORM" style="width:80px">
<%
sql="select * from channel_sort where father_sort<>0"
rs.open SQL,conn,1,1
%>
<%
while not rs.EOF
id=rs("id")
%>
<option value="<%=rs("id")%>" ><%=rs("cnname")%></option>
<%
rs.movenext
wend
rs.close
%>
</select> 另外页面中的调用:
比如说想要调用用户选择的列表项目,就用这个提取
channel=request("id")这句就可以提出来用户选择的列表项目id,如果想要该项目的信息,
用sql查询一下就可以了.
比如对应上面的代码,我需要的信息用如下代码查询出来: '文章所在栏目
sort_id=trim(request("channel"))
sql="select * from channel_sort where id='"&sort_id&"'"
rs.open sql,conn,1,1
sort_name=rs("enname")
sort_path=rs("sort_path")
rs.close不知道是不是这个意思.
告诉你asp+sql2000的吧.
下拉类表:
<select name="channel" class="FORM" style="width:80px">
<%
sql="select * from channel_sort where father_sort<>0"
rs.open SQL,conn,1,1
%>
<%
while not rs.EOF
id=rs("id")
%>
<option value="<%=rs("id")%>" ><%=rs("cnname")%></option>
<%
rs.movenext
wend
rs.close
%>
</select> 另外页面中的调用:
比如说想要调用用户选择的列表项目,就用这个提取
channel=request("id")这句就可以提出来用户选择的列表项目id,如果想要该项目的信息,
用sql查询一下就可以了.
比如对应上面的代码,我需要的信息用如下代码查询出来: '文章所在栏目
sort_id=trim(request("channel"))
sql="select * from channel_sort where id='"&sort_id&"'"
rs.open sql,conn,1,1
sort_name=rs("enname")
sort_path=rs("sort_path")
rs.close不知道是不是这个意思.
<select onchange="getSelect(this)">
<option value=1>第一个</option>
<option value=2>第二个</option>
<option value=3>第三个</option>
</select>
<div id="child">
<select name="select">
</select>
</div>
<script language='javascript'>
function getSelect(sel)
{
var i = document.frames.deal;
i.document.location.href="test2.php?id="+sel.options[sel.selectedIndex].value;
}
function setSelect(op)
{
var sel = document.all.child;
sel.innerHTML = "<select>"+op+"</select>";
}
</script>
<iframe width=0 height=0 id=deal >
</iframe>
-----------------------------------------------------------------
test2.php
<?
if (isset($_GET['id']))
{
//这里可以通过查询数据库得到数据写入$op;
$op = "";
for ($i=0; $i<3; $i++)
$op .= "<option value=".$i.">第".$_GET['id']."项的".$i."</option>";
echo "<script>
parent.setSelect('".$op."');
</script>";
}
?>