Menu

How to add hidden field - date/time stamp?

Help
Anonymous
2003-07-23
2013-06-03
  • Anonymous

    Anonymous - 2003-07-23

    How can this be completed?

     
    • Jose

      Jose - 2003-09-01

      Hey Scott,
      I have inserted this code so that it displays date and time "<!--#echo var="DATE_LOCAL" -->" ... you will have to make the file extension to a .shtml file.  also you will have to manually edit the file and remove 3 "/" that get added for some reason.  the output results look as follows, "Sunday, 31-Aug-2003 01:01:05 Central Daylight Time".  If anybody knows how to shorten the results so that it only displays the date/time, please post the solution ...
      hth

       
      • Ben

        Ben - 2004-10-11

        this will make the time, ip and browser to display in the admin, sorry if any error included, but I just wrote it after reading your question, and it did work in my test.

        in process.php find
        xxxxxx
        else{
        $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
        xxxxxx
        add after
        xxxxxx
        $date=date("m/d/Y H:i:s");
        $browser=$HTTP_USER_AGENT;
        $ip=$REMOTE_ADDR;
        xxxxxx

        then find
        xxxxxx
        $make=fopen("admin/data.dat","a");
        xxxxxx
        below this edit the line
        xxxxxx
        $to_put .= $fieldname."|".$2ndfield."

        to end up with something like
        xxxxxx
        $make=fopen("admin/data.dat","a");
        $to_put="";
        $to_put .= $fieldname."|".$2ndfield."|".$date."|".$browser."|".$ip."
        ";
        fwrite($make,$to_put);
        ?>
        xxxxxx
        you could also edit the email sent here

         
    • Jose

      Jose - 2003-09-01

      Hey Scott,
      I found a better solution, insert the following code.  " <?php print date("m-d-Y,  H:i:s") ?>" .. the output is as follows "09-01-2003, 12:36:31" ... Your file type will be a .php file if you select this method.

       
    • Musawir Ali

      Musawir Ali - 2003-09-02

      santos .. those are all well and good, but that doesn't seem like a permenant hack :P also, it probably doesn't serve the purpose initially intended. The code you mention simply prints the date ...  the request is to have it sent as part of the form submitted (as a hidden form field).
      ok back to the request.. hmm.. i thought i had added a date/time stamp as an option for the hidden fields.. oh well, its not a biggie so i'll just plug it in there and release another version real quick.

       
    • Jose

      Jose - 2003-09-02

      It does send the date/time stamp as a hidden field.  but anyways, if you can make us a better one please do, as yours will probably be better anyways.

       

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.