Hi guys, hoping someone can shed some light. I have a script that I've been using for a while to submit a date to Mysql. Its been working fine but now I'm trying it on a site I'm building and when I hit submit NO date is entered into Mysql. I've been over and over it and the only thing I can think is its a php5 compatibility issue as I have only used it with php4 in the past. Anyway really interested to find out the problem.

$date_array = explode ("-" ,$row['date']);
$month = $date_array[1];
include_once ("../../includes/form.date.php");
// form.date include --- //

<tr>
<td align="right" valign="top" width="75">Date From:</td>
<td><select name="date15_date">
	
<?php 
// MAKE DATE DROP DOWN --- //
$days = range (01, 31);	
foreach ($days as $value) 
{	
echo '<option value="'.$value.'" ';
		
if ($_POST['date15_date']) 
{ 
if ($_POST['date15_date'] == $value)
{
				echo "selected";
			} 
		} 
		else
		{
			if ($date_array[2] == $value)
			{
				echo "selected";
			} 
		}
		echo '>'.$value.'</option>';
	}
	// ----------------------- //
	?>
	
</select>&nbsp;

<select name="date15_month">
<!--<option>-->
	<option value="01" <? 	if (($_POST['date15_month']) && ($_POST['date15_month'] == "01")) { echo "selected"; } elseif ((!$_POST['date15_month']) && ($month == "01")) { echo "selected"; } ?>>January</option>
	<option value="02" <? 	if (($_POST['date15_month']) && ($_POST['date15_month'] == "02")) { echo "selected"; } elseif ((!$_POST['date15_month']) && ($month == "02")) { echo "selected"; } ?>>February</option>
	<option value="03" <? 	if (($_POST['date15_month']) && ($_POST['date15_month'] == "03")) { echo "selected"; } elseif ((!$_POST['date15_month']) && ($month == "03")) { echo "selected"; } ?>>March</option>
	<option value="04" <? 	if (($_POST['date15_month']) && ($_POST['date15_month'] == "04")) { echo "selected"; } elseif ((!$_POST['date15_month']) && ($month == "04")) { echo "selected"; } ?>>April</option>
	<option value="05" <? 	if (($_POST['date15_month']) && ($_POST['date15_month'] == "05")) { echo "selected"; } elseif ((!$_POST['date15_month']) && ($month == "05")) { echo "selected"; } ?>>May</option>
	<option value="06" <? 	if (($_POST['date15_month']) && ($_POST['date15_month'] == "06")) { echo "selected"; } elseif ((!$_POST['date15_month']) && ($month == "06")) { echo "selected"; } ?>>June</option>
	<option value="07" <? 	if (($_POST['date15_month']) && ($_POST['date15_month'] == "07")) { echo "selected"; } elseif ((!$_POST['date15_month']) && ($month == "07")) { echo "selected"; } ?>>July</option>
	<option value="08" <? 	if (($_POST['date15_month']) && ($_POST['date15_month'] == "08")) { echo "selected"; } elseif ((!$_POST['date15_month']) && ($month == "08")) { echo "selected"; } ?>>August</option>
	<option value="09" <? 	if (($_POST['date15_month']) && ($_POST['date15_month'] == "09")) { echo "selected"; } elseif ((!$_POST['date15_month']) && ($month == "09")) { echo "selected"; } ?>>September</option>
	<option value="10" <? 	if (($_POST['date15_month']) && ($_POST['date15_month'] == "10")) { echo "selected"; } elseif ((!$_POST['date15_month']) && ($month == "10")) { echo "selected"; } ?>>October</option>
	<option value="11" <? 	if (($_POST['date15_month']) && ($_POST['date15_month'] == "11")) { echo "selected"; } elseif ((!$_POST['date15_month']) && ($month == "11")) { echo "selected"; } ?>>November</option>
	<option value="12" <? 	if (($_POST['date15_month']) && ($_POST['date15_month'] == "12")) { echo "selected"; } elseif ((!$_POST['date15_month']) && ($month == "12")) { echo "selected"; } ?>>December</option>
</select>&nbsp;

<?php // MAKE YEAR ARRAYS --- //
$date_to    = (date('Y') + 5);
$years = range (2007, $date_to);	?>
<select name="date15_year">
						
<?php
foreach ($years as $value)
{
	echo '<option value="'.$value.'" ';
	if ($_POST['date15_year'])
	{
		if ($_POST['date15_year'] == $value)
		{
			echo "selected";
		}
	}
	else
	{ 
		if (date('Y') == $value) 
		{
			echo "selected";
		}
	}
	echo '>'.$value.'</option>';
}	?>

</select>
</td>
			</tr>

Thanks....

Maybe it got to do with

$date		=	$date15_year.'-'.$date15_month.' '.$date15_date;

Maybe it got to do with

$date		=	$date15_year.'-'.$date15_month.' '.$date15_date;

No. That is just fine. Use print_r($_POST); to see what is getting posted and what is not.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.