br3nn4n Posted January 8, 2008 Share Posted January 8, 2008 Code: <?php echo "<input type=\"text\" name=\"page\" value=\"<?php date(D); ?>\">"; ?> Results in a text box with the text "<?php date(D); ?>" in it. How do I do it? TIA Link to comment https://forums.phpfreaks.com/topic/85080-solved-use-date-as-html/ Share on other sites More sharing options...
Ken2k7 Posted January 8, 2008 Share Posted January 8, 2008 <?php echo "<input type=\"text\" name=\"page\" value=\"".date("m.d.y")."\">"; ?> Link to comment https://forums.phpfreaks.com/topic/85080-solved-use-date-as-html/#findComment-433925 Share on other sites More sharing options...
rhodesa Posted January 8, 2008 Share Posted January 8, 2008 either do this: <?php echo "<input type=\"text\" name=\"page\" value=\"".date(D)."\">"; ?> or this: <input type="text" name="page" value="<?php echo date(D); ?>"> Link to comment https://forums.phpfreaks.com/topic/85080-solved-use-date-as-html/#findComment-433926 Share on other sites More sharing options...
Ken2k7 Posted January 8, 2008 Share Posted January 8, 2008 The D still have to be in quotes right? Link to comment https://forums.phpfreaks.com/topic/85080-solved-use-date-as-html/#findComment-433927 Share on other sites More sharing options...
GingerRobot Posted January 8, 2008 Share Posted January 8, 2008 The D still have to be in quotes right? Yes. Unless you happened to have a constant called D which contained the string 'D'... Link to comment https://forums.phpfreaks.com/topic/85080-solved-use-date-as-html/#findComment-433931 Share on other sites More sharing options...
rhodesa Posted January 8, 2008 Share Posted January 8, 2008 yeah...D in quotes...sorry about that Link to comment https://forums.phpfreaks.com/topic/85080-solved-use-date-as-html/#findComment-433933 Share on other sites More sharing options...
br3nn4n Posted January 8, 2008 Author Share Posted January 8, 2008 Awesome, works! Thanks once again everyone Link to comment https://forums.phpfreaks.com/topic/85080-solved-use-date-as-html/#findComment-434023 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.