jeppers Posted October 25, 2007 Share Posted October 25, 2007 All i want to do is retrieve the data from this pull down menu. and print it on a different form. hear is my pull down menu what do u reckon <body> <form action="calender.php" method="post"> <?php //make the months array $months = array (1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); //make the days and years array $days = range (1, 31); $years = range (2007, 2020); //make that months pull down menus echo '<select name="months">'; foreach ($months as $key => $value) { echo "<option value=\"$key\">$value</option>\n"; } echo '</select>'; //make the days pull down menu echo '<select name="days">'; foreach ($days as $key => $value) { echo "<option value=\"$key\">$value</option>\n"; } echo '</select>'; //make the year pull down menu echo '<select name="years">'; foreach ($years as $key => $value) { echo "<option value=\"$key\">$value</option>\n"; } echo '</select>'; ?> <input type="submit" name="submit" value="submit" /> Link to comment https://forums.phpfreaks.com/topic/74788-solved-hi-i-beginners-question/ Share on other sites More sharing options...
wildteen88 Posted October 25, 2007 Share Posted October 25, 2007 Well to retrieve the selected day, month and year on the page the form gets submitted you'd use $_POST['days'] $_POST['months'] and $_POST['years'] variables. Link to comment https://forums.phpfreaks.com/topic/74788-solved-hi-i-beginners-question/#findComment-378124 Share on other sites More sharing options...
jeppers Posted October 25, 2007 Author Share Posted October 25, 2007 thanks for the last post help lost but my next problem is that its taking the array values like the number which in the array.. for example 3 august 2007 would pint out as 3 8 0. i want to no how to keep the number string values and number size. how i retrieved the variables $days = ($_POST['days']); $months = ($_POST['months']); $years = ($_POST['years'] as string); //create a date variable $date = $days .''. $months .''. $years; echo "$date"; can u help thanks Link to comment https://forums.phpfreaks.com/topic/74788-solved-hi-i-beginners-question/#findComment-378160 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.