Jump to content

How to make a list from 2 dates


chrispos

Recommended Posts

I have a page with 3 drop down lists one for day of the month, one for month and one for year. what I am trying to do is use something that will enable me to make each day from the selected dates to appear as individual days. So if someone selected 1st of September and then 23rd of September it would show 1 2 3 4 5 up to 23. I need to be able to put this in a database.

 

The make date is easy and I think I need to use explode but when I have seen this it comes out with 1, 2, 3, 4, and I do not want to use the comer.

 

This is what I am using for the dates.

 

<?php
$d = $_POST['d'];
$m = $_POST['m'];
$y = $_POST['y'];
$d1 = $_POST['d1'];
$m1 = $_POST['m1'];
$y1 = $_POST['y1'];
$date = date ("M-d-Y", mktime(0, 0, 0, $m, $d, $y));
$date1 = date ("M-d-Y", mktime(0, 0, 0, $m1, $d1, $y1));
?>

 

It will also have prices with these dates so if the user puts in 20.00 for day 1 it would need to go in for the dates selected. ie

1st 20.00

2nd 20.00 and so on.

 

Any ideas or help would be appreciated

 

Many Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.