2013-03-31 59 views
0

做,我不認爲我傳遞從我降「WEEK_NUM」數值下降到我的第二頁被存儲。如何檢查什麼價值時,選擇在PHP

$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>'; 

我的第二頁顯示: 打印 「 」;周選擇=選擇團隊和一個只包括第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)) 
+1

我可能是錯的,並且很久沒有研究PHP了,但是「#_post []」不需要是「$ _POST []」嗎? =) – Timmy

+0

$ varWeek = $ _ POST [ 'Week_select']; ... ...和方法=後你的第一個PHP形式) – Hackerman

回答

2

你錯在你的第2頁的開頭代碼來自這條線:

$varWeek=#_post['Week_select']; 

應該

$varWeek=$_POST['Week_select']; 
+0

注意大小寫的區別也=) – Timmy

+0

WOW!謝謝!現在我該如何擺脫'打印' 「;'在選定的一週之前的第2頁顯示= 2? –

+0

發現它並不理想。 –