我收到了以下回复:
注意:第 11 行 Page1.php 中未定义的索引 yy
注意:第 12 行 Page1.php 中未定义的索引 mm
注意:第 13 行 Page1.php 中未定义的索引 dd
我该如何定义这些yy, mm, dd?
<?php
$redirect_page = 'Page2.php';
$_SESSION['yy'] = $_POST['yy']; // This is on line 11
$_SESSION['mm'] = $_POST['mm']; // This is on line 12
$_SESSION['dd'] = $_POST['dada']; // This is on line 13
if (isset($_POST['Submit'])) {
header('Location: ' . $redirect_page);
}
?>
<HTML>
<Form name="Page1" action="" method="POST">
<select name="yy">
<option value="2001">2001</option>
// ...Another 100 years
</select>
<select name="mm">
<option value="1">1</option>
<option value="2">2</option>
// ... another 10 months
</select>
<select name="dd">
<option value="1">1</option>
<option value="2">2</option>
// ...another 29 days
</select>
<input type="Submit" name="Submit" value="Submit">
</Form>
</HTML>