Get user ID on a form

Asked

Viewed 67 times

0

I will develop a WEB platform, and in the software in a certain context there is the possibility for a certain user to view the profile of other users, see their public information registered and in form linked to face profile, send messages to any of the list. I intend to implement the sending and receiving of messages in the same Frontend. I have an idea of how to get the text typed in the message field, but I also wanted to get the ID of the user who typed in the field, to play this information to the profile of the user who receives the message, and from there he can see the message, and, using the sender’s ID, photo and name. But I don’t have much idea of how to do that, so answer me there, who has already implemented something like that, or has some logic that would be of great value to me. From now on, thank you!

1 answer

0


If I understand what you want to do, you can try the following: Even if you want to do everything in the Front End, you will need some kind of Backend to at least persist the data, unless you want to save everything in file, which would give you more work than setting up a simple backend, and saving in file is not a good practice. With the backend set, 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 section
  • Just associate this information from the section on the message object.

A simple tip to do all this is to use Angular 2+ and Firebase as backend to save your data, if you don’t already know, it is worth taking a look, with few lines will authenticate and get the data you want.

Note: The backend is indispensable in your scenario, How Web Applications Work.

  • Thank you so much for the tip!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.