コンボボックスから前のページの値を取得しようとしています。
[削除.php]
<form name="delete" action="deleted.php" method="post">
<?php
$connect = mysql_connect("a","b","") or die("Error connecting");
mysql_select_db("c") or die("Error connecting to database");
$result = mysql_query("SELECT * FROM d ORDER BY e ASC");
echo "<select name='forward'>";
while ($row = mysql_fetch_array($result))
{
echo "<option class='class' name=" .$row['t'] . ">".$row['t'] ."</option>";
}
echo "</select><br/><br/><br/><br/>";
?>
<input type="submit" id="thisSbmit" value="Delete Contact" onClick="chck()"> <input type="button" id="cls" class="cls" value="Clear">
</form>
[削除された.php]
<?php
$selected = $_POST['forward'];
if ($selected== 'kryptix')
{
alert('No one was seleclted');
}else{
alert('Success');
}
?>
しかし、私は次のエラーが発生します:
注意: 未定義のインデックス: 2 行目の C:\xampp\htdocs\folder\deleted.php の前方
- 行 2 = $selected = $_POST['forward']; *
ここで何が間違っていますか?