I have made a form in form.php where one of the form elements consist of <select> component to select the day of the month.
form.php:
Code: Select all
<?php
<form name="formTest" method="post" action = "blahblah.php">
<select name = "day">
<?php
for ($i = 1; $i < 32; $i++) {
echo "<option value = '$i'>".$i."</option>";
}
?>
</select>
</form>
?>
blahblah.php:
Code: Select all
<?php
$_SESSION['day'] = $_POST['day'];
<form name="formTestReview" method="post" action="submit.php">
<select name = "day">
<?php
for ($i = 1; $i < 32; $i++) {
echo "<option value = '$i'>".$_SESSION['day']."</option>";
}
?>
</select>
</form>
?>
Code: Select all
echo "<option value = '$i'>".$_SESSION['day']."</option>";Please help me to retrieve the selected day in the form.php and display the value in the formTestReview within the <option> tag....thanks.
Chris