coderzm Posted August 4, 2015 Share Posted August 4, 2015 Hi all, I have some questions about creating a simple PHP user management system. I would like to create a website for users where they are able to a. Register an account b. Login and c. View information unique to them. 1. If my website is www.mywebsite.com, how do I create a different URL for different registered users upon login. For example, if User A logs in, he/she will see www.mywebsite.com/userA 2. If each user has access to unique data, how do I create the URLs to look like this - www.mywebsite.com/userA/example-page Appreciate any pointers. Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/297621-user-management-system-questions/ Share on other sites More sharing options...
NotionCommotion Posted August 4, 2015 Share Posted August 4, 2015 While you "could" use a different URL for different users, it is not recommended. Instead, why not just display different content from the same URL based on the user's logon status as defined by a session? Quote Link to comment https://forums.phpfreaks.com/topic/297621-user-management-system-questions/#findComment-1517985 Share on other sites More sharing options...
coderzm Posted August 4, 2015 Author Share Posted August 4, 2015 Hi NotionCommotion, Thanks for your reply. Yeah, I would have a user.php file that renders dynamic content based on username. However, changing the url to www.mywebsite.com/userA seems to be the "usual" practice as seen in FB, Instagram, Twitter, etc. That's the reason for me trying to do that. Quote Link to comment https://forums.phpfreaks.com/topic/297621-user-management-system-questions/#findComment-1517987 Share on other sites More sharing options...
Solution gizmola Posted August 4, 2015 Solution Share Posted August 4, 2015 That is only something you would do if there is a public facing aspect to the system, where other users would be able to see information about the user in question, or interact with them in some way. Facebook and Twitter are both social networks that are driven by that design. Most systems don't do that unless it's specifically for the reason of providing a public facing page for others. When you login to Facebook, your url's don't all become Facebook.com/yourname/.... Quote Link to comment https://forums.phpfreaks.com/topic/297621-user-management-system-questions/#findComment-1517996 Share on other sites More sharing options...
coderzm Posted August 4, 2015 Author Share Posted August 4, 2015 Hi Gizmola, Ah yes.. That TOTALLY made sense. I see what you mean about it being public facing. I don't intend to make my system public facing, and other users will not be able to view others' URL. Thanks for your input! Quote Link to comment https://forums.phpfreaks.com/topic/297621-user-management-system-questions/#findComment-1518001 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.