Jump to content

Making a Form Return Date/Time Info


smy101

Recommended Posts

Could someone please show me the proper code to have a simple HTML/PHP form return the time and date the form was submitted for Central Time zone?

I have a basic "feedback" form that I would like to also print out the exact date & time the form was submitted when it returns the rest of the information on the form.

Thanks in advance for any help.
Link to comment
Share on other sites

[quote author=thorpe link=topic=118574.msg484624#msg484624 date=1166081295]
Just insert a timestamp into the database allong with the feedback. eg;

[code]
INSERT INTO feedback (feedback,datetime) VALUES ('$feedback',NOW());
[/code]
[/quote]


Thank you for such a quick response, but I'm confused on where you mean I should put that code.

The form is not operating with a database.  Upon submit, it simply emails me the returned values.

Basically I have an HTML form which upon "Submit" uses the php script to gather the values and email them to me.
Link to comment
Share on other sites

Well in that case you'll need to use the [url=http://php.net/date]date[/url]() function to create a timestamp and concatinate it into your message.

And as CV so quickly pointed out, you'll also need to adjust it to your servers time vs CST.

Post your code if you want more then a push.
Link to comment
Share on other sites

well..if you aren't storing any of this stuff in a database, and just wanting the time sent to you in your email, along with your other info..doesn't your email already have a timestamp already built in, for when you received the email?

nonetheless, if you are wanting it to send in your email, look into php's [url=http://us3.php.net/time]time[/url] function.

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.