Hi there,
I'm trying to put the actual date in a form like month/day/year, but is not working. It returns like
01
01
01
02
01
03
01
...
you can check it out at http://membres.lycos.fr/aliensd/test2.php
and the code is:
<?php
$date = gmdate("Ymd");
$day = substr($date,6,2);
$month = substr($date,4,2);
$year = substr($date,0,4);
print "<select name=\"month\">";
$n=1;
while($n<=12) {
print "<option>".date("m", $row["day"])."</option><option";
if ($n==$month) {
print " selected";
}
if ($n<10) {
print ">0$n</option>";
}
else {
print ">$n</option>";
}
$n++;
}
print "</select>";
print " / ";
print "<select name=\"day\">";
$n=1;
while($n<=31) {
print "<option>".date("d", $row["day"])."</option><option";
if ($n==$day) {
print " selected";
}
if ($n<10) {
print ">0$n</option>";
}
else {
print ">$n</option>";
}
$n++;
}
print "</select>";
print " / ";
print "<select name=\"year\">";
$n=1999;
while($n<=2004) {
print "<option>".date("Y", $row["day"])."</option><option";
if ($n==$year) {
print " selected";
}
print ">$n</option>";
$n++;
}
print "</select>";
?>
Thank you for your help.