<?php 
    function DateSelector($inName, $useDate=0) 
    { 
        /* create array so we can name months */ 
        $monthName = array(1=> "januari", "februari", "maart", 
            "april", "mei", "juni", "Juli", "augustus", 
            "september", "oktober", "november", "december"); 
      
        /* if date invalid or not supplied, use current time */ 
        if($useDate == 0) 
        { 
            $useDate = Time(); 
        } 

        /* make day selector */ 
        echo "<SELECT NAME=" . $inName . "Day>\n"; 
        for($currentDay=1; $currentDay <= 31; $currentDay++) 
        { 
            echo "<OPTION VALUE=\"$currentDay\""; 
            if(intval(date( "d", $useDate))==$currentDay) 
            { 
                echo " SELECTED"; 
            } 
            echo ">$currentDay\n"; 
        } 
        echo "</SELECT>"; 

        /* make month selector */ 
        echo "<SELECT NAME=" . $inName . "Month>\n"; 
        for($currentMonth = 1; $currentMonth <= 12; $currentMonth++) 
        { 
            echo "<OPTION VALUE=\""; 
            echo intval($currentMonth); 
            echo "\""; 
            if(intval(date( "m", $useDate))==$currentMonth) 
            { 
                echo " SELECTED"; 
            } 
            echo ">" . $monthName[$currentMonth] . "\n"; 
        } 
        echo "</SELECT>"; 

        /* make year selector */ 
        echo "<SELECT NAME=" . $inName . "Year>\n"; 
        $startYear = date( "Y", $useDate); 
        for($currentYear = $startYear - 5; $currentYear <= $startYear+5;$currentYear++) 
        { 
            echo "<OPTION VALUE=\"$currentYear\""; 
            if(date( "Y", $useDate)==$currentYear) 
            { 
                echo " SELECTED"; 
            } 
            echo ">$currentYear\n"; 
        } 
        echo "</SELECT>"; 
     
    } 
?> 


form.php

[code]<?php include("dateselect.php"); ?>
<html>
<head>
</head>
<body>
<form method="post" action="add.php">
<TABLE>
<TR>
<TD>TEST:
<TD>
<input type=TEXT Name=TEST width=20>
</TD>
</TR>
<TR>
   <TD>datum:</TD>
   <TD>
      <!-- You can use PHP functions to automatically get the value of date -->
<?php DateSelector('day','month','year'); ?>
   </TD>
</TR>
<TR>
   <TD></TD><br>
   <TD><INPUT TYPE="submit" name="submit" value="submit"></TD> 
</TR>
</TABLE>
</form>

<body>
<html>[/code]

add.php

[code]<?php 
//initilize PHP
{
   //convert all the posts to variables:
   $message = $_POST['message'];
   $TEST = $_POST['TEST'];
   $tijd = $_POST['tijd'];
   $Dag = $_POST['dayDay'];
   $Maand = $_POST['dayMonth'];
   $Jaar = $_POST['dayYear'];
   // Dit is date VELD in je tabel
   $Datum = $Jaar."-".$Maand."-".$Dag; 
}
?>
   
<table width=50%>
<tr><td>Jaar: </td><td> <?php echo $Jaar; ?> </td></tr>
<tr><td>Dag: </td><td> <?php echo $Dag; ?> </td></tr>
<tr><td>Maand: </td><td> <?php echo $Maand; ?> </td></tr>
<tr><td>Datum: </td><td> <?php echo $Datum; ?> </td></tr>
<tr><td>Test: </td><td> <?php echo $TEST; ?> </td></tr>
</table>
[/code]