• Hello,

    Im making a site where i have logged in user who should send a form with different stuff in it. Thats ok.
    But!
    I want to see when they have sent the form wich user that have sent it.

    This must be possible, anyone that knows how to do it?

Viewing 4 replies - 1 through 4 (of 4 total)
  • if the user is logged in, you can get the user id using the below code:

    global $current_user;
          get_currentuserinfo();
    $user_id = $current_user->user_ID;

    Now, when the form is sent, you can save the current time in wp_usermeta table. Use like this:

    $current_time = time();
    update_usermeta($user_id, 'form_sent_at', $current_time);

    Thread Starter dynamitharry

    (@dynamitharry)

    Thank you very much for the answer!

    But i don’t get it to work. Do you use the FormBuilder plugin?

    Where should i put this code? I try to put it in the value field. but it does not seems right to put this there, all i get in the e-mail that is sent to me is the whole code.

    Can i put this in the page and then call something in the value field?

    thank you!

    I just downloaded and checked this plugin. I am not sure, but I think you need to add this code in main formbuilder.php file. The mail function is called on line 1285. You can try in this area.

    Thread Starter dynamitharry

    (@dynamitharry)

    Cool, i’m gonna check it out!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘FormBuilder get_currentuserinfo’ is closed to new replies.