Get user ID on a form

0

I will develop a WEB platform, and in the software in a certain context there is the possibility for a certain user to see the profile of other users, see their public information registered and in a form linked to the profile profile, send messages to any of the list . I want to implement sending and receiving messages in the same FrontEnd. I have idea how to get the text typed in the field for the message, but also wanted to get the user ID that typed in the field, to throw this information to the profile of the user who receives the message, and from there he can see the message , and using the ID, photo and sender's name. But I have no idea how to do this, so answer me there, who has already implemented something of the type, or have some logic that would be of great value to me. Thanks in advance!

    
asked by anonymous 31.08.2018 / 21:52

1 answer

0

If I understand what you do, you can try the following: Even if you want to do everything in the Front End, you'll need some kind of BackEnd to at least persist the data, unless you want to save everything to a file, which would give you more work than setting up a simple backend, save to file not be a good practice. With the backend defined, do:

  • Create a login system for registration (name, photo, email, etc ...)
  • After the login system
  • After the user logs into your application, you will have this user available in the
  • Only associate this section information with the message object.

A simple tip to do all this is to use Angular 2+ and Firebase as a backend to save your data, if you do not know it yet, it's worth a look, with a few lines you will do the authentication and get the data you want want.

Note: The backend is indispensable in your scenario, How web applications work .

    
31.08.2018 / 22:25