PC Nerd Posted December 15, 2007 Share Posted December 15, 2007 Hi, Ive got the following code, and its meant to display the possilbe days hours and minutes within 2 months, and then place it into a timstamp for storage in the database. Im also looking for a way to get the timestamp and turn it back into the 3 menus, using the <option... selected> values. CREATE THE ARRAYS FOR THE DROP DOWN MENUS $Days = array(); $Hours = array(); $Minutes = array(); for($i=time();$i< strtotime('+2 months');$i += 86400) { $day = date("d/m/y - l", $i); $Days[$i] = $day; } for($i = 0; $i < 24;$i++) { $hour = $i * 60 * 60; $Hours[$i] = $hour; } for ($i = 0; $i < 60; $i++) { $Minutes[$i] = $i*60; } DROP DOWN MENUS Start Date: <select name = 'Start_date_day'><?php foreach($Days as $field => $value) { echo "<option value = '".$field."'>".$value."</option>\n";} ?></select> Hour: <select name = 'Start_date_hour'><?php foreach($Hours as $field => $value) { echo "\t<option value = '".$value."'>".$field."</option>\n";} ?></select> Minutes: <select name = 'Start_date_minute'><?php foreach($Minutes as $field => $value) { echo "\t<option value = '".$value."'>".$field."</option>\n";} ?></select> <br><br> Finish date: <select name = 'Finish_date_day'><?php foreach($Days as $field => $value) { echo "<option value = '".$field."'>".$value."</option>\n";} ?></select> Hour: <select name = 'Finish_date_hour'><?php foreach($Hours as $field => $value) { echo "\t<option value = '".$value."'>".$field."</option>\n";} ?></select> Minutes: <select name = 'Finish_date_minute'><?php foreach($Minutes as $field => $value) { echo "\t<option value = '".$value."'>".$field."</option>\n";} ?></select> <br><br> Can Anyone tell me how i am meant to creat the timestamps form these values? at the moment im simply adding the three values together - ie $days + hours + minutes..... but thats on the form handling page. Thanks, PC_Nerd Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted December 15, 2007 Author Share Posted December 15, 2007 ***bump*** Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted December 15, 2007 Author Share Posted December 15, 2007 ***bump*** does anyoen have any ideas? or do i need to explain it better?? Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.