testservers Posted April 3, 2011 Share Posted April 3, 2011 Hello, I'm using a from on my website to get shipping quotes from YRC. Everything works fine, but now I'd like to have the date submitted with the from instead of the user having to input the date. I'm using Dreamweaver CS3. Below is what I had as the hidden date field. <input type="hidden" name="PU_DATE" value="<?php echo $date; ?>" /> I tried a few samples that I search for on Google, but the display page on YRC returns an error. The date have to be submitted as mm/dd/yy. How can I post the form to YRC with the current date submitted with it? Thanks for your valued time. Kevin [uPDATE] The code from my fist post appears to be working on on the form. When I send the form to YRC it displays a shipping quote... which mean the date have been input. Quote Link to comment https://forums.phpfreaks.com/topic/232538-i-need-help-sending-current-date-hidden-in-form-field-using-post-method/ Share on other sites More sharing options...
mreish Posted April 3, 2011 Share Posted April 3, 2011 I'm not sure what a YRC is but depending on the format you need for the date, you'll want to put something like this: <input type="hidden" name="PU_DATE" value="<?php echo date('j/d/Y'); ?>" /> will return: <input type="hidden" name="PU_DATE" value="04/03/11" /> Check the PHP manual for date formatting here. Quote Link to comment https://forums.phpfreaks.com/topic/232538-i-need-help-sending-current-date-hidden-in-form-field-using-post-method/#findComment-1196345 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.