0

我认为我没有将下拉菜单中的“week_num”数值传递到我的第二页。

$wquery="select week_num,week_name from stats_week where season=$this_season order by week_num";
$wresult=mysql_query($wquery);
    print "Select Week:<select name='Week_select'><br>\n";
    while ($wrow=mysql_fetch_array($wresult))
    { 
    print '<option value="'.$wrow['week_num'].'">'.'week '.$wrow['week_num'].'     '.$wrow['week_name'].'</option><br>\n';  
    }
print "</select>";


    print'<button type="submit" >Next</button>';

我的第二页显示:打印“”;week selected = 选择团队和仅包含第 1 周团队的下拉框。

第2页的开始代码:

   $varWeek=#_post['Week_select'];
print "week selected = $varWeek";
 print'<form action="changeplayer_3.php" method="post">';  
  $tquery="select st.team_num,st.name from stats_team st left join stats_results sr on st.team_num=sr.team_num where sr.season=$this_season and sr.week=$varWeek group by st.team_num order by name";
    $tresult=mysql_query($tquery);
    print "Select team:<select name='team_select'><br>\n";
    while ($trow=mysql_fetch_assoc($tresult))
4

1 回答 1

2

您的错误来自第 2 页开头代码中的这一行:

$varWeek=#_post['Week_select'];

它应该是

$varWeek=$_POST['Week_select'];
于 2013-03-31T23:24:20.180 回答