Guest Posted November 14, 2012 Share Posted November 14, 2012 I have a form with a field for users to type in the current date. My question is, is there any way for me to have the current date to automatically populate in this field? Here's the code I am using: <tr> <td><b>Date Assigned (YYYY-MM-DD):</b> <br /><input type="text" name="date_assign" size="25" /><br /> </tr> If I could get todays date to automatically pop in this that would be great! Thanks Link to comment https://forums.phpfreaks.com/topic/270700-php-date-code-help-needed/ Share on other sites More sharing options...
Scott_S Posted November 14, 2012 Share Posted November 14, 2012 look at input's value attribute Link to comment https://forums.phpfreaks.com/topic/270700-php-date-code-help-needed/#findComment-1392457 Share on other sites More sharing options...
Manixat Posted November 14, 2012 Share Posted November 14, 2012 <input type="text" name="date_assign" size="25" value="<?php echo date('Y-m-d',time()); ?>"/> Link to comment https://forums.phpfreaks.com/topic/270700-php-date-code-help-needed/#findComment-1392459 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.