-1
我有一個php頁面,它是一種帶有3個下拉部分的子表單,它必須在您單擊按鈕時從下拉列表中選擇。形式如下:將會話變量從一個頁面傳遞到另一個
<div class="statsValPlate">
<label>Main Score</label>
<select name="scoreSelect">
<option value="301">301</option>
<option value="501">501</option>
<option value="701">701</option>
<option value="1001">1001</option>
</select>
</div>
<div class="statsValPlate">
<label>Legs Format</label>
<select name="legSelect">
<option value="3">2 of 3</option>
<option value="5">3 of 5</option>
<option value="7">4 of 7</option>
<option value="9">5 of 9</option>
</select>
</div>
<div class="statsValPlate">
<label>Sets Format</label>
<select name="setSelect ">
<option value="3">2 of 3</option>
<option value="5">3 of 5</option>
<option value="7">4 of 7</option>
<option value="9">5 of 9</option>
</select>
</div>
<form method="get" action="scoreboard.php">
<button id="submit" name ="submit" class="push_button red">Start Game</a><br>
</form>
<?php
$_SESSION['gameScore'] = $_POST['scoreSelect'];
$_SESSION['legScore'] = $_POST['legSelect'];
$_SESSION['setScore'] = $_POST['setSelect'];
?>
,我想例如第一種形式的選擇必須顯示爲一個標籤值這裏:
<label class="scorePlate" id="num1" value="<?php echo $_SESSION['gameScore']?>">
<!--<?php echo $_SESSION["player1Score"]?>-->
<script>
document.write(new_score_player_1);
</script>
</label>
但由於某種原因,這是行不通的。有什麼問題
當您提交給網頁它去'scoreboard.php'所以如何設置' $ _SESSION'在該頁面中? –