Jump to content

I Need Help Sending Current Date Hidden In Form Field Using Post Method


Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.