Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help on date

Status
Not open for further replies.

crazybeans128

Programmer
Aug 5, 2003
79
US
I have a form and when i click the submit button, i want to send the current date and time through along with the other information. Suggestions?

 

Assuming this form is coming from a web page... do you want the current date and time from the client's computer or do you want to use the date and time on the web server?

If you want the client's date and time, you can use Javascript to set the value of a form field just as you submit the form (and then collect that data server-side).

If you want the current date and time from the server, then you need to poke around in the php manual pages for the date() function (and it's related masks), and the section on sessions for details on how to persist data across pages.

Cheers,
Jeff
 
I already created a way to do it with Javascript, but can i run the function then submit the form? that's the main thing i'm wondering about. Right now i have a button you click to update the date and time field, but i'd rather just have the single button a function then submit.

 
Yeah, i guess it would, but it still involves PHP, but i'll head on over to the javascript section.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top