For each user, you need to create a separate file (such as profile1.php , profile2.php , etc.)?
So that another registered user can view his profile.

  • no, there is no need to create a separate file for each .................... I see not your first question and they are so poor quality, it is clear that you have read little about these PLs. ...... and solved trite reading books on PHP and MySQL. Or by viewing a video course on PHP for example from [Specialist] ....... I think you should start with them - Alexey Shimansky
  • The option of creating the UserProfiles table in the database and storing information there looks, in my opinion, much better. - Regent
  • one
    Take a look at this section at your leisure: Books and learning resources on PHP - Alexey Shimansky
  • Yes, I recently began to read about pekhepe, but kursych burns (you need to somehow pass quickly, so I ask questions in a hurry and "poor quality." I apologize! And ATP - As Lan

1 answer 1

What are you, no, of course. PHP is the language in which this kind of action is prevented. This can be done in one file, but first decide on the access levels of type user / moderator / administrator.

When registering, for example, set the default user level and send everyone with the level "user" to a file such as "level_user.php", and administrators to "level_admin.php", you shouldn’t get everything into a single file for good, or you will get confused "if / else"

In general, familiarize yourself with OOP style PHP (object-oriented programming) and MVC (Model-View-Controller: model-view-controller).

And the user definition by id can be set via $ _GET, for example, in the link "/profile_user.php&user_id=65464654" "user_id" the key by which you can get the user id like this:

 $user_id = $_GET['user_id']; 

and do not forget to process everything that comes through the $ _GET / $ _ POST / $ _ COOKIE global arrays, for example, digits for id lead to the same integer (int) and whatever it comes to, or it will be a whole digit or zero.

 $user_id = (int)$_GET['user_id']; 

actually our variable "$ user_id" now has an id with which we access the database.

If I understand you correctly of course.