重定向到类似于获取网址的网址[已关闭]

I am designing a website similar to Facebook, Instagram... Which have a profile page for each user. My question is: If a user wants to view the profile of another one, is this technique usable? (the user id here will be for example 123)

http://localhost/viewprofile.php?user_id=123

Then I will get the user_id from $_GET and retrieve the user information from the database and display them.

Yes it is a good technique, user gets the profile using the GET parameter, otherwise you can use POST but since there is no delicate information so this approach as you mentioned is fine.