I've got a form with a field called datebirth[];
After submitting the form; it must put the datebirth field (or fields) into the mysql format yyyy-mm-dd and after that put it in a session:
$date_array = split("-", $_POST['datebirth']); $mysqldate = $date_array[2]."-".$date_array[1]."-".$date_array[0]; $_SESSION['datebirth'] = array(); $_SESSION['datebirth'] = $mysqldate;
This is my code till now but i'm stuck (when proccesing it i'm only getting Array... as output).. Can someone help me?
Well, is it $_POST['benchmark'] or $_POST['benchmark'][0] for the first date? If your form element is actually named "benchmark[]" then it's the second.
That said, you may be able to just pass the original date to strtotime() and format the resulting unix timestamp.
-- ---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
PHP|Architect: A magazine for PHP Professionals – www.phparch.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php