select传值问题
时间:2007-02-17 来源:PHP爱好者
<? include("../include/opendb.php");
$sql="select username from user group by username order by id DESC";
$rs=Execute($sql);$row=NumRows($rs);
?>
<script>
function selectsubmit(form){
var username="<?echo $username;?>";
window.location="a_controlmag.php?active=up&mselt="+mselt+"&username="+username;
}
</script>
<body><form name="form" method="post" action="">
<table width="100%" border="1" align="center">
<tr><td width="10%">username</td><td width="30%">modify</td></tr>
<?while($row = FetchArray($rs)){?>
<tr><td><?=$row[username]?></td>
<?$sql1="select username from user where username = '$row[username]' ";
$rs1=Execute($sql1);$row1=NumRows($rs1);
?>
<td>
<input type="hidden" name="username" value="<?echo $row[username] ;?>">
<select name="mselt" id="select" onChange="selectsubmit(this.form);">
<option value="0" <?if($row1=="0"){echo "selected";}?>>closed</option>
<option value="1" <?if($row1=="1"){echo "selected";}?>>opened</option>
</select></td>
</tr><?}?></table></form></body>
请问点击选择框后如何得到mselt和username的值
php爱好者站 http://www.phpfans.net php动态|php基础|php进阶|php模板.
$sql="select username from user group by username order by id DESC";
$rs=Execute($sql);$row=NumRows($rs);
?>
<script>
function selectsubmit(form){
var username="<?echo $username;?>";
window.location="a_controlmag.php?active=up&mselt="+mselt+"&username="+username;
}
</script>
<body><form name="form" method="post" action="">
<table width="100%" border="1" align="center">
<tr><td width="10%">username</td><td width="30%">modify</td></tr>
<?while($row = FetchArray($rs)){?>
<tr><td><?=$row[username]?></td>
<?$sql1="select username from user where username = '$row[username]' ";
$rs1=Execute($sql1);$row1=NumRows($rs1);
?>
<td>
<input type="hidden" name="username" value="<?echo $row[username] ;?>">
<select name="mselt" id="select" onChange="selectsubmit(this.form);">
<option value="0" <?if($row1=="0"){echo "selected";}?>>closed</option>
<option value="1" <?if($row1=="1"){echo "selected";}?>>opened</option>
</select></td>
</tr><?}?></table></form></body>
请问点击选择框后如何得到mselt和username的值
php爱好者站 http://www.phpfans.net php动态|php基础|php进阶|php模板.
相关阅读 更多 +