beesbane Posted July 8, 2011 Share Posted July 8, 2011 I'm sure this is covered somewhere, but I have been looking at it for the past hour probably, and it is so basic that I must just be missing something. I have a form. 3 different dropdowns (<select> with options) to make the date. Then when it is submitted to post, the following won't work: $month = $_POST["month"]; $day = $_POST["day"]; $year = $_POST["year"]; $date = $month, " ", $day, ", ", $year; or $date = $_POST["month"], " ", $_POST["day"], ", ", $_POST["year"]; It has got to be syntax, because all other variables defined with $_POST work just fine. How do I create this string? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/241393-commas-and-variables/ Share on other sites More sharing options...
trq Posted July 8, 2011 Share Posted July 8, 2011 Use dots, not commas. Quote Link to comment https://forums.phpfreaks.com/topic/241393-commas-and-variables/#findComment-1239972 Share on other sites More sharing options...
harristweed Posted July 8, 2011 Share Posted July 8, 2011 For dates on forms, a datepicker is a better option. http://jqueryui.com/demos/datepicker/ Quote Link to comment https://forums.phpfreaks.com/topic/241393-commas-and-variables/#findComment-1239974 Share on other sites More sharing options...
beesbane Posted July 8, 2011 Author Share Posted July 8, 2011 Perfect! Thank you both!!! Quote Link to comment https://forums.phpfreaks.com/topic/241393-commas-and-variables/#findComment-1240137 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.