Results 1 to 3 of 3

Thread: Passing a Date/Time of Submit in Form

  1. #1
    Join Date
    Oct 2011
    Posts
    2

    Default Passing a Date/Time of Submit in Form

    How do I generate and then pass the Date/Time of form Submission???


    s.

  2. #2
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Passing a Date/Time of Submit in Form

    check out derive fields.

    the guide has examples of this:
    http://www.tectite.com/fmhowto/derived.php

  3. #3
    Join Date
    Jul 2011
    Posts
    45

    Default Re: Passing a Date/Time of Submit in Form

    Simplified example for clarity:-

    <?
    $emaildate = date("d/m/Y"); // set email date
    $servertime = time ();
    $servertime = $servertime - 3600;
    $emailtime = date("G:i",$servertime); // set email time
    ?>
    ...
    <form name="enqform" method="post" action="http://www.mysite.com/formmail.php">
    ...
    <input type="hidden" name="emaildate" value="<? echo($emaildate) ?>" />
    <input type="hidden" name="emailtime" value="<? echo($emailtime) ?>" />
    ...
    </form>


    In this example I've subtracted 3600 from the servertime because the time of the server is one hour ahead of local time, which is what I want in the email. You can adjust as necessary. Note also the formatting of the date and time - once again, you can change it as required, of course.

    Using derived fields you can use something like

    <input type="hidden" name="derive_fields" value="Date=%dom0%.%'/'%.%moy0%.%'/'%.%fullyear%,Time=%hour240%.%':'%.%min%" />

    but that doesn't allow for an offset between server time and local time.
    Last edited by Ben; 11-Oct-2011 at 10:41 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Unable to get the date and time in to csv file
    By Atma in forum Community Support
    Replies: 4
    Last Post: 20-May-2010, 03:20 PM
  2. Date and Time Stamp
    By BeauSanders in forum Community Support
    Replies: 2
    Last Post: 14-Mar-2010, 11:09 PM
  3. Time & Date
    By patto9405 in forum Community Support
    Replies: 2
    Last Post: 26-Oct-2008, 07:39 PM
  4. Time and Date Help
    By snickers123 in forum Community Support
    Replies: 0
    Last Post: 02-Jun-2008, 04:23 AM
  5. Time date stamp in email
    By basnyd in forum FormMail Subscription Support
    Replies: 1
    Last Post: 02-Dec-2005, 02:01 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •