Menu

Date/Time Stamp for version 3.0?

Help
jweisberg
2008-03-04
2013-06-03
  • jweisberg

    jweisberg - 2008-03-04

    First of all, I love this site!  These forms work great!  I just need to know one thing...
    Does anyone know how I can include a date/timestamp to the submitted data?

    I am using the "Create a new form" online tool at: http://phpformgen.sourceforge.net/new_demo/phpformgen/
    with both email submission and I am saving data to a txt file.

    I downloaded the zip file and then I tried adding a hidden field to the form.html page:

    <input type="hidden" name="dtstamp" id="dtstamp">

    I then added "$dtstamp=date("m.d.Y, H:i:s");" right after the following in processor.php:

    $where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));

    and then after my last field which is Country: " . $_POST['field_15'] . " - I put:

    Date and Time: " . $_POST['dtstamp'] . " to see if it would add the dtstamp hidden field to my output txt file.

    Can anyone clue me into where I am going wrong?  Is there a way I can get a date/time stamp using phpFormGenerator v3?

     
    • TNTEverett

      TNTEverett - 2008-03-04

      You have the right idea but you don't need anything in the form.html file. 
      Change this line
      Date and Time: " . $_POST['dtstamp'] . "
      to
      Date and Time: " . $dtstamp . "

       
    • jweisberg

      jweisberg - 2008-03-05

      Works perfect!  Thanks!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.